Home | Trees | Indices | Help |
|
---|
|
object --+ | exceptions.BaseException --+ | exceptions.Exception --+ | DNSException
Abstract base class shared by all dnspython exceptions.
It supports two basic modes of operation:
a) Old/compatible mode is used if ``__init__`` was called with empty *kwargs*. In compatible mode all *args* are passed to the standard Python Exception class as before and all *args* are printed by the standard ``__str__`` implementation. Class variable ``msg`` (or doc string if ``msg`` is ``None``) is returned from ``str()`` if *args* is empty.
b) New/parametrized mode is used if ``__init__`` was called with non-empty *kwargs*. In the new mode *args* must be empty and all kwargs must match those set in class variable ``supp_kwargs``. All kwargs are stored inside ``self.kwargs`` and used in a new ``__str__`` implementation to construct a formatted message based on the ``fmt`` class variable, a ``string``.
In the simplest case it is enough to override the ``supp_kwargs`` and ``fmt`` class variables to get nice parametrized messages.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
fmt = None hash(x) |
|||
msg = None hash(x) |
|||
supp_kwargs =
|
|
|||
Inherited from Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
str(x)
|
Old exceptions supported only args and not kwargs. For sanity we do not allow to mix old and new behavior. |
Format kwargs before printing them. Resulting dictionary has to have keys necessary for str.format call on fmt class variable. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Dec 8 10:59:55 2018 | http://epydoc.sourceforge.net |