Skip to content

error_message

frog.gui.error_message ¤

For showing error messages.

Functions¤

show_error_message(parent, msg, title='An error has occurred') ¤

Show an error message in the GUI and write to the program log.

Source code in frog/gui/error_message.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def show_error_message(
    parent: QWidget | None, msg: str, title="An error has occurred"
) -> None:
    """Show an error message in the GUI and write to the program log."""
    # Show popup box in GUI
    msg_box = QMessageBox(
        QMessageBox.Icon.Critical,
        title,
        msg,
        QMessageBox.StandardButton.Ok,
        parent,
    )
    msg_box.exec()

    # Write to program log
    logging.error(msg)