mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 21:15:52 +08:00
Dump stacktrace for all threads in CrashReport
CURA-3836 This helps debugging issues like CURA-3836
This commit is contained in:
parent
76a9a9a9ab
commit
a386e6d867
@ -2,6 +2,9 @@ import sys
|
|||||||
import platform
|
import platform
|
||||||
import traceback
|
import traceback
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
import faulthandler
|
||||||
|
import tempfile
|
||||||
|
import os
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, Qt, QCoreApplication
|
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, Qt, QCoreApplication
|
||||||
@ -91,6 +94,17 @@ def show(exception_type, value, tb):
|
|||||||
crash_info = "Version: {0}\nPlatform: {1}\nQt: {2}\nPyQt: {3}\n\nException:\n{4}"
|
crash_info = "Version: {0}\nPlatform: {1}\nQt: {2}\nPyQt: {3}\n\nException:\n{4}"
|
||||||
crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, trace)
|
crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, trace)
|
||||||
|
|
||||||
|
tmp_file_fd, tmp_file_path = tempfile.mkstemp(prefix = "cura-crash", text = True)
|
||||||
|
os.close(tmp_file_fd)
|
||||||
|
with open(tmp_file_path, "w") as f:
|
||||||
|
faulthandler.dump_traceback(f, all_threads=True)
|
||||||
|
with open(tmp_file_path, "r") as f:
|
||||||
|
data = f.read()
|
||||||
|
|
||||||
|
msg = "-------------------------\n"
|
||||||
|
msg += data
|
||||||
|
crash_info += "\n\n" + msg
|
||||||
|
|
||||||
textarea.setText(crash_info)
|
textarea.setText(crash_info)
|
||||||
|
|
||||||
buttons = QDialogButtonBox(QDialogButtonBox.Close, dialog)
|
buttons = QDialogButtonBox(QDialogButtonBox.Close, dialog)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user