Added stacktrace to critical exception message box.
This commit is contained in:
parent
fe545f2233
commit
7e0995ca25
@ -1382,14 +1382,28 @@ def handle_exception( exc_type, exc_value, exc_traceback ):
|
||||
filename = os.path.basename( filename )
|
||||
error = "%s: %s" % ( exc_type.__name__, exc_value )
|
||||
|
||||
QMessageBox.critical(None, "Houston, we have a problem...",
|
||||
"Whoops. A critical error has occured. This is most likely a bug "
|
||||
"in Qubes Manager.<br><br>"
|
||||
"<b><i>%s</i></b>" % error +
|
||||
"at <b>line %d</b> of file <b>%s</b>.<br/><br/>"
|
||||
% ( line, filename ))
|
||||
strace = ""
|
||||
stacktrace = traceback.extract_tb( exc_traceback )
|
||||
while len(stacktrace) > 0:
|
||||
(filename, line, func, txt) = stacktrace.pop()
|
||||
strace += "----\n"
|
||||
strace += "line: %s\n" %txt
|
||||
strace += "func: %s\n" %func
|
||||
strace += "line no.: %d\n" %line
|
||||
strace += "file: %s\n" %filename
|
||||
|
||||
msg_box = QMessageBox()
|
||||
msg_box.setDetailedText(strace)
|
||||
msg_box.setIcon(QMessageBox.Critical)
|
||||
msg_box.setWindowTitle( "Houston, we have a problem...")
|
||||
msg_box.setText("Whoops. A critical error has occured. This is most likely a bug "
|
||||
"in Qubes Manager.<br><br>"
|
||||
"<b><i>%s</i></b>" % error +
|
||||
"<br/>at line <b>%d</b><br/>of file %s.<br/><br/>"
|
||||
% ( line, filename ))
|
||||
|
||||
msg_box.exec_()
|
||||
|
||||
#sys.exit(1)
|
||||
|
||||
def main():
|
||||
|
||||
|
@ -630,12 +630,27 @@ def handle_exception( exc_type, exc_value, exc_traceback ):
|
||||
filename = os.path.basename( filename )
|
||||
error = "%s: %s" % ( exc_type.__name__, exc_value )
|
||||
|
||||
QMessageBox.critical(None, "Houston, we have a problem...",
|
||||
"Whoops. A critical error has occured. This is most likely a bug "
|
||||
"in Qubes VM Settings application.<br><br>"
|
||||
"<b><i>%s</i></b>" % error +
|
||||
"at <b>line %d</b> of file <b>%s</b>.<br/><br/>"
|
||||
% ( line, filename ))
|
||||
strace = ""
|
||||
stacktrace = traceback.extract_tb( exc_traceback )
|
||||
while len(stacktrace) > 0:
|
||||
(filename, line, func, txt) = stacktrace.pop()
|
||||
strace += "----\n"
|
||||
strace += "line: %s\n" %txt
|
||||
strace += "func: %s\n" %func
|
||||
strace += "line no.: %d\n" %line
|
||||
strace += "file: %s\n" %filename
|
||||
|
||||
msg_box = QMessageBox()
|
||||
msg_box.setDetailedText(strace)
|
||||
msg_box.setIcon(QMessageBox.Critical)
|
||||
msg_box.setWindowTitle( "Houston, we have a problem...")
|
||||
msg_box.setText("Whoops. A critical error has occured. This is most likely a bug "
|
||||
"in Qubes Manager.<br><br>"
|
||||
"<b><i>%s</i></b>" % error +
|
||||
"<br/>at line <b>%d</b><br/>of file %s.<br/><br/>"
|
||||
% ( line, filename ))
|
||||
|
||||
msg_box.exec_()
|
||||
|
||||
|
||||
def main():
|
||||
|
Loading…
Reference in New Issue
Block a user