From bc44324be0b3d39800bfe7afd699789aa19f6d43 Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Wed, 29 Apr 2020 19:49:30 -0500 Subject: [PATCH] Draft: show the error message of the ToDo class in the terminal The error is both sent to the log file and to the console instead of only the log. This is helpful to troubleshoot problems with the delayed execution of commands, such as when testing a relatively broken version like 1827eb17ae. --- src/Mod/Draft/draftutils/todo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftutils/todo.py b/src/Mod/Draft/draftutils/todo.py index d2da1bf4dc..0da52aab82 100644 --- a/src/Mod/Draft/draftutils/todo.py +++ b/src/Mod/Draft/draftutils/todo.py @@ -40,7 +40,7 @@ from PySide import QtCore import FreeCAD import FreeCADGui -from draftutils.messages import _msg, _wrn, _log +from draftutils.messages import _msg, _wrn, _err, _log __title__ = "FreeCAD Draft Workbench, Todo class" __author__ = "Yorik van Havre " @@ -136,6 +136,7 @@ class ToDo: f() except Exception: _log(traceback.format_exc()) + _err(traceback.format_exc()) wrn = ("ToDo.doTasks, Unexpected error:\n" "{0}\n" "in {1}({2})".format(sys.exc_info()[0], f, arg)) @@ -164,6 +165,7 @@ class ToDo: FreeCAD.ActiveDocument.commitTransaction() except Exception: _log(traceback.format_exc()) + _err(traceback.format_exc()) wrn = ("ToDo.doTasks, Unexpected error:\n" "{0}\n" "in {1}".format(sys.exc_info()[0], func)) @@ -184,6 +186,7 @@ class ToDo: f() except Exception: _log(traceback.format_exc()) + _err(traceback.format_exc()) wrn = ("ToDo.doTasks, Unexpected error:\n" "{0}\n" "in {1}({2})".format(sys.exc_info()[0], f, arg))