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.
This commit is contained in:
vocx-fc
2020-04-29 19:49:30 -05:00
committed by Yorik van Havre
parent c1696f20dc
commit bc44324be0

View File

@@ -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))