Skip to content

Commit 0d6ccf6

Browse files
authored
Merge pull request #118 from Avasam/show-errors-outside-main-thread
Fixes #86 Stop uncaught exceptions from silently crashing the app
2 parents 393ca84 + cc6066c commit 0d6ccf6

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/AutoSplit.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
DISPLAY_RESIZE_WIDTH = 240
3434
DISPLAY_RESIZE_HEIGHT = 180
3535
DISPLAY_RESIZE = (DISPLAY_RESIZE_WIDTH, DISPLAY_RESIZE_HEIGHT)
36-
36+
CREATE_NEW_ISSUE_MESSAGE = \
37+
"Please create a New Issue at <a href='https://github.com/Toufool/Auto-Split/issues'>"
38+
"github.com/Toufool/Auto-Split/issues</a>, describe what happened, and copy & paste the error message below"
3739

3840
class AutoSplit(QtWidgets.QMainWindow, design.Ui_MainWindow):
3941
from hotkeys import send_command
@@ -1216,9 +1218,7 @@ def main():
12161218
# Print error to console if not running in executable
12171219
if getattr(sys, 'frozen', False):
12181220
error_messages.exceptionTraceback(
1219-
"AutoSplit encountered an unrecoverable exception and will now close itself.<br/>"
1220-
"Please copy the following message over at<br/>"
1221-
"<a href='https://github.com/Toufool/Auto-Split/issues'>github.com/Toufool/Auto-Split/issues</a>",
1221+
f"AutoSplit encountered an unrecoverable exception and will now close. {CREATE_NEW_ISSUE_MESSAGE}",
12221222
exception)
12231223
else:
12241224
traceback.print_exception(type(exception), exception, exception.__traceback__)
@@ -1236,9 +1236,7 @@ def excepthook(exceptionType: Type[BaseException], exception: BaseException, tra
12361236
sys.exit(0)
12371237
error_messages.exceptionTraceback(
12381238
"AutoSplit encountered an unhandled exception and will try to recover, "
1239-
"however, things may not work quite right.<br/>"
1240-
"Please copy the following message over at<br/>"
1241-
"<a href='https://github.com/Toufool/Auto-Split/issues'>github.com/Toufool/Auto-Split/issues</a>",
1239+
f"however, there is no guarantee everything will work properly. {CREATE_NEW_ISSUE_MESSAGE}",
12421240
exception)
12431241

12441242

0 commit comments

Comments
 (0)