Skip to content

uncaught_exceptions

frog.gui.uncaught_exceptions ¤

Code for handling uncaught exceptions.

Functions¤

set_uncaught_exception_handler(parent) ¤

Catches uncaught exceptions so we can log them and display a dialog.

Details of the exception, including the stack trace, will be written to the program log and displayed to the user in a pop-up dialog. Note that this won't happen if you're running the program in a debugger that intercepts these exceptions first!

The purpose is to make it easier for end-users to communicate with the developers when a bug occurs.

Source code in frog/gui/uncaught_exceptions.py
19
20
21
22
23
24
25
26
27
28
29
def set_uncaught_exception_handler(parent: QWidget) -> None:
    """Catches uncaught exceptions so we can log them and display a dialog.

    Details of the exception, including the stack trace, will be written to the program
    log and displayed to the user in a pop-up dialog. Note that this won't happen if
    you're running the program in a debugger that intercepts these exceptions first!

    The purpose is to make it easier for end-users to communicate with the developers
    when a bug occurs.
    """
    sys.excepthook = partial(_handle_exception, parent)