mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06:00
Use the Logger to report uncaught exceptions
Makes for a nicer and clearer output of uncaught exceptions
This commit is contained in:
parent
0aea7bdb5c
commit
44f8744c84
1 changed files with 6 additions and 1 deletions
|
@ -5,6 +5,8 @@ import webbrowser
|
|||
|
||||
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication
|
||||
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit
|
||||
|
||||
from UM.Logger import Logger
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
@ -13,7 +15,10 @@ def show(exception_type, value, tb):
|
|||
if QCoreApplication.instance():
|
||||
debug_mode = QCoreApplication.instance().getCommandLineOption("debug-mode", False)
|
||||
|
||||
traceback.print_exception(exception_type, value, tb)
|
||||
Logger.log("c", "An uncaught exception has occurred!")
|
||||
for line in traceback.format_exception(exception_type, value, tb):
|
||||
for part in line.rstrip("\n").split("\n"):
|
||||
Logger.log("c", part)
|
||||
|
||||
if not debug_mode:
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue