ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Library Reference
9. File Formats
9.5 xdrlib -- Encode and decode XDR data
9.5.3 Exceptions

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Library Reference >> 9. File Formats >> 9.5 xdrlib -- Encode and decode XDR data
ActivePython 2.5 documentation


9.5.3 Exceptions

Exceptions in this module are coded as class instances:

exception Error
The base exception class. Error has a single public data member msg containing the description of the error.

exception 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.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved