taskwiki: Handle TaskWikiExceptions without traceback

This commit is contained in:
Tomas Babej 2015-04-02 20:59:25 +02:00
parent ee59095368
commit 03fbc0d7eb

View file

@ -23,6 +23,15 @@ from tasklib.task import TaskWarrior
BASE_DIR = vim.eval("s:plugin_path") BASE_DIR = vim.eval("s:plugin_path")
sys.path.insert(0, os.path.join(BASE_DIR, 'taskwiki')) sys.path.insert(0, os.path.join(BASE_DIR, 'taskwiki'))
# Handle exceptions without traceback, if they're TaskWikiException
def output_exception(exception_type, value, tb):
if exception_type is util.TaskWikiException:
print(unicode(value), file=sys.stderr)
else:
sys.__excepthook__(exception_type, value, tb)
sys.excepthook = output_exception
import cache import cache
import util import util
import viewport import viewport