every error class provides a "DOMAIN" attribute specifying the
domain of the error and a "CODES" attribute, which lists all
exceptions to be handled as
error_code : (error message, hint message)
pairs. When instantiating an error, a second string can be
passed to the constructor that contains additional localized
information about where the error occurred.
Inheriting from this class makes the code dictionaries from
all base classes available to the subclass (entries with the
same code are overwritten by the subclass). This way, the data
class hierarchy can be effectively shadowed by an error class
hierarchy without having to duplicate base-class level error
codes.
|