[Tutor] Handling exceptions

Gerhardus Geldenhuis gerhardus.geldenhuis at gmail.com
Mon Nov 7 12:52:24 CET 2011

I am trying to handle exceptions for a xmlrpc class interfacing with

The exception:

 xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'invalid profile name:

and the experimental code.

    server = xmlrpclib.Server("")
  except xmlrpclib.Fault as detail:

    print 'xmlrpc error'
    print detail
#    print detail.arguments
    print repr(detail)

I don't understand what I am getting from the exception. Do I only get a
string and is the above snippet a good/clean/nice way of handling it. If I
only get a string then it is likely that I will have to have  few if's to
handle the various error strings returned.


Gerhardus Geldenhuis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111107/122191bd/attachment.html>

More information about the Tutor mailing list