mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 15:53:07 +02:00
taskwiki: Handle TaskWikiExceptions without traceback
This commit is contained in:
parent
ee59095368
commit
03fbc0d7eb
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue