Skip to content

Exceptions

mininterface.exceptions

Exceptions that might make sense to be used outside the library.

Cancelled

User has cancelled. A SystemExit based exception noting that the program exits without a traceback, ex. if user hits the escape or closes the window.

ValidationFail

Signal to the form that submit failed and we want to restore it.

InterfaceNotAvailable

Interface failed to init, ex. display not available in GUI. Or an underlying dependency was uninstalled.

DependencyRequired

__call__(*args, **kwargs)

This is an elagant way to handling missing functions. Consider this case.

try:
    from .._lib.cli_parser import parse_cli
except DependencyRequired as e:
    parse_cli = e

When the function is used, the original exception is raised.

exit()

Wrap the exception in a SystemExit so that the program exits without a traceback.