Exceptions

Exceptions in this module are coded as class instances:


\begin{excdesc}{Error}
The base exception class. \code{Error} has a single public data
member \code{msg} containing the description of the error.
\end{excdesc}


\begin{excdesc}{ConversionError}
Class derived from \code{Error}. Contains no additional instance
variables.
\end{excdesc}

Here is an example of how you would catch one of these exceptions:

import xdrlib
p = xdrlib.Packer()
try:
    p.pack_double(8.01)
except xdrlib.ConversionError, instance:
    print 'packing the double failed:', instance.msg