Yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/xdr-exceptions.html

From ZCubes Wiki
Revision as of 20:02, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="navigation"> {| width="100%" cellspacing="2" align="center" | yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/xdr-unpacker-objects.html|[[Image...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


12.9.3 Exceptions

Exceptions in this module are coded as class instances:

Error
The base exception class. Error has a single public data member msg containing the description of the error.
ConversionError
Class derived from Error. Contains no additional instance variables.

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

See About this document... for information on suggesting changes.