Error Module

hedwig.error

exception hedwig.error.Error

Base class for exceptions in this application.

exception hedwig.error.DatabaseError(orig)

Base class for exceptions raised by the database.

exception hedwig.error.DatabaseIntegrityError(orig)

Error for database integrity failures.

exception hedwig.error.FormattedError(fmt_string, *fmt_args)

Base class for exceptions with formatted messages.

exception hedwig.error.CalculatorError(fmt_string, *fmt_args)

Error class for calculator errors.

exception hedwig.error.ConsistencyError(fmt_string, *fmt_args)

Error for when the applications detects database inconsistency.

exception hedwig.error.ConversionError(fmt_string, *fmt_args)

Error class for file conversion errors.

exception hedwig.error.NoSuchRecord(fmt_string, *fmt_args)

Error for when an expected database record is not present.

This should only be used when a method is given an explicit record primary key such that the record non-existance is clearly unexpected. In a searching operation, methods should instead return None or an empty collection as appropriate.

exception hedwig.error.NoSuchValue(fmt_string, *fmt_args)

Error for when the given value is not recognised.

exception hedwig.error.MultipleRecords(fmt_string, *fmt_args)

Error for when the database unexpectedly returns multiple records when only one was expected.

exception hedwig.error.ParseError(fmt_string, *fmt_args)

Exception class for errors encountered when attempting to parse values.

exception hedwig.error.UserError(fmt_string, *fmt_args)

Exception class for errors which are presumed to result from user input and with a message suitable for display to the user.

hedwig.error._truncate_message(message, max_length=500, start_length=200, end_length=200)

Function to trim an error message to avoid excessively long log messages.