Skip to content

Commit

Permalink
Draft: show the error message of the ToDo class in the terminal
Browse files Browse the repository at this point in the history
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 d7a9f2e.
  • Loading branch information
vocx-fc authored and yorikvanhavre committed May 4, 2020
1 parent ad92c99 commit 14423df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Mod/Draft/draftutils/todo.py
Expand Up @@ -40,7 +40,7 @@

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>"
Expand Down Expand Up @@ -136,6 +136,7 @@ def doTasks():
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))
Expand Down Expand Up @@ -164,6 +165,7 @@ def doTasks():
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))
Expand All @@ -184,6 +186,7 @@ def doTasks():
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))
Expand Down

0 comments on commit 14423df

Please sign in to comment.