Exemple #1
0
 def _report_error(cls, mess, err):
     """Report an error with dialog."""
     from geomop_dialogs import GMErrorDialog
     if cls.main_window is not None:
         err_dialog = GMErrorDialog(cls.main_window)
         err_dialog.open_error_dialog(mess, err)
     else:
         raise Exception(mess)
        def on_unhandled_exception(type_, exception, tback):
            """Unhandled exception callback."""
            # pylint: disable=unused-argument
            from geomop_dialogs import GMErrorDialog
            if model_editor is not None:
                err_dialog = None
                # display message box with the exception
                if model_editor.mainwindow is not None:
                    err_dialog = GMErrorDialog(model_editor.mainwindow)

                # try to reload editor to avoid inconsistent state
                if callable(model_editor.mainwindow.reload):
                    try:
                        model_editor.mainwindow.reload()
                    except:
                        if err_dialog is not None:
                            err_dialog.open_error_dialog("Application performed invalid operation!",
                                                         error=exception)
                            sys.exit(1)

                if err_dialog is not None:
                    err_dialog.open_error_dialog("Unhandled Exception!", error=exception)
Exemple #3
0
 def _report_notify(cls, errs):
     """Report an error with dialog."""
     from geomop_dialogs import GMErrorDialog
     err_dialog = GMErrorDialog(cls.main_window)
     err_dialog.open_error_report_dialog(errs)