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 d7a9f2ebf9.
This commit is contained in:
@@ -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 <yorik@uncreated.net>"
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user