exceptions Subpackage

Subackage Description

Provides fundamental exceptions.

Abstract Signatures

class utilia.exceptions.Exception_BASE

Abstract base class for all utilia exceptions.

Use this for your exception handler signature if you wish to catch any exception raised from within utilia.

class utilia.exceptions.Error_BASE

Abstract base class for all utilia exceptions which are regarded as errors.

Use this for your exception handler signature if you wish to catch any error condition raised from within utilia.

Fundamental Classes

class utilia.exceptions.Exception_WithReason(reason_format, *reason_args)

Mix-in class for all utilia exceptions which carry a translatable format string and a tuple of arguments for substitution into the format string.

Inherits from object.

Use this for your exception handler signature if you wish to catch any exception, which has a translatable reason string, raised from within utilia.

reason_args

Arguments to be substituted into the format string for presentation as the reason for the exception. The arguments are substituted into reason_format.

reason_format

Format string, containing zero or more format-style substitution tokens, for presentation as the reason for the exception. The substitions come from reason_args.

translated(translator)

Returns a translated string expressing the reason for the exception.

class utilia.exceptions.Exception_Exiting(reason_format, *reason_args)

Mix-in class for all utilia exceptions which carry a translatable format string, a tuple of arguments for substitution into the format string, and a return code that could be supplied to a SystemExit exception.

Inherits from Exception_WithReason.

Use this for your exception handler signature if you wish to catch any exception, which has a return code and a described reason, raised from within utilia.

rc

The return code.

reason_args

Arguments to be substituted into the format string for presentation as the reason for the exception. The arguments are substituted into reason_format.

reason_format

Format string, containing zero or more format-style substitution tokens, for presentation as the reason for the exception. The substitions come from reason_args.

translated(translator)

Returns a translated string expressing the reason for the exception.

General Exceptions

class utilia.exceptions.InvalidKeyError(reason_format, *reason_args)

Exception class representing the error condition where a key of a particular name is not permissible. (Note that this is different than the error condition where a key is expected but missing.)

Inherits from Exception_Exiting and KeyError.

rc

The return code.

reason_args

Arguments to be substituted into the format string for presentation as the reason for the exception. The arguments are substituted into reason_format.

reason_format

Format string, containing zero or more format-style substitution tokens, for presentation as the reason for the exception. The substitions come from reason_args.

translated(translator)

Returns a translated string expressing the reason for the exception.

class utilia.exceptions.UnknownKeyError(reason_format, *reason_args)

Exception class representing the error condition where a key of a particular name is expected but missing. (Note that this is different than the error condition where a key is forbidden.)

Inherits from Exception_Exiting and KeyError.

rc

The return code.

reason_args

Arguments to be substituted into the format string for presentation as the reason for the exception. The arguments are substituted into reason_format.

reason_format

Format string, containing zero or more format-style substitution tokens, for presentation as the reason for the exception. The substitions come from reason_args.

translated(translator)

Returns a translated string expressing the reason for the exception.

class utilia.exceptions.InvalidValueError(reason_format, *reason_args)

Exception class representing the error condition where a value is considered invalid in a particular context.

Inherits from Exception_Exiting and ValueError.

rc

The return code.

reason_args

Arguments to be substituted into the format string for presentation as the reason for the exception. The arguments are substituted into reason_format.

reason_format

Format string, containing zero or more format-style substitution tokens, for presentation as the reason for the exception. The substitions come from reason_args.

translated(translator)

Returns a translated string expressing the reason for the exception.

class utilia.exceptions.InvokedAbstractMethodError(reason_format, *reason_args)

Exception class representing the error condition where an abstract method should have not been invoked in a superclass.

Inherits from Exception_Exiting and RuntimeError.

rc

The return code.

reason_args

Arguments to be substituted into the format string for presentation as the reason for the exception. The arguments are substituted into reason_format.

reason_format

Format string, containing zero or more format-style substitution tokens, for presentation as the reason for the exception. The substitions come from reason_args.

translated(translator)

Returns a translated string expressing the reason for the exception.

Subpackages and Modules