Here is the hierarchy of notable exceptions raised by this module:
As you can see, every exception exc among them verifies:
issubclass(exc, error)
so if you don’t need fine-grained error handling, simply catch error (which will probably be accessible as dialog.error from your program) and you should be safe.
Changed in version 2.12: PythonDialogIOError is now a subclass of PythonDialogOSError in order to help with the transition from IOError to OSError in the Python language. With this change, you can safely replace except PythonDialogIOError clauses with except PythonDialogOSError even if running under Python < 3.3.
Bases: dialog.error
Exception raised when the dialog executable can’t be found.
Bases: dialog.error
Exception raised when pythondialog is used in an incorrect way.
Bases: dialog.error
Exception raised when pythondialog cannot perform a “system operation” (e.g., a system call) that should work in “normal” situations.
This is a convenience exception: PythonDialogIOError, PythonDialogOSError and PythonDialogErrorBeforeExecInChildProcess all derive from this exception. As a consequence, watching for PythonDialogSystemError instead of the aformentioned exceptions is enough if you don’t need precise details about these kinds of errors.
Don’t confuse this exception with Python’s builtin SystemError exception.
Bases: dialog.PythonDialogSystemError
Exception raised when pythondialog catches an OSError exception that should be passed to the calling program.
Bases: dialog.PythonDialogOSError
Exception raised when pythondialog catches an IOError exception that should be passed to the calling program.
This exception should not be raised starting from Python 3.3, as the built-in exception IOError becomes an alias of OSError.
Changed in version 2.12: PythonDialogIOError is now a subclass of PythonDialogOSError in order to help with the transition from IOError to OSError in the Python language. With this change, you can safely replace except PythonDialogIOError clauses with except PythonDialogOSError even if running under Python < 3.3.
Bases: dialog.PythonDialogSystemError
Exception raised when an exception is caught in a child process before the exec sytem call (included).
This can happen in uncomfortable situations such as:
- the system being out of memory;
- the maximum number of open file descriptors being reached;
- the dialog-like program being removed (or made non-executable) between the time we found it with _find_in_path() and the time the exec system call attempted to execute it;
- the Python program trying to call the dialog-like program with arguments that cannot be represented in the user’s locale (LC_CTYPE).
Bases: dialog.PythonDialogSystemError
Exception raised when pythondialog catches a re.error exception.
Bases: dialog.error
Exception raised when the dialog-like program returns something not expected by pythondialog.
Bases: dialog.error
Exception raised when the dialog-like program is terminated by a signal.
Bases: dialog.error
Exception raised when the dialog-like program exits with the code indicating an error.
Bases: dialog.error
Exception raised when we cannot retrieve the version string of the dialog-like backend.
New in version 2.14.
Bases: dialog.error
Exception raised when we cannot parse the version string of the dialog-like backend.
New in version 2.14.
Bases: dialog.UnableToParseBackendVersion
Exception raised when we cannot parse the version string of the dialog backend.
New in version 2.14.
Bases: dialog.error
Exception raised when the backend version in use is inadequate in a given situation.
New in version 2.14.
Bases: dialog.error
Exception raised when pythondialog finds a bug in his own code.
Bases: dialog.error
Exception raised when pythondialog behaves in a way that seems to indicate a Python bug.