SIDL exceptions are caught very much like normal Python exceptions except the Python exception class of the SIDL type must be used. The exception value holds the SIDL object as attribute exception. Below is an example of catching exceptions from a call to getFib.
try: fib.getFib(-1, 10, 10, 0) except ExceptionTest.NegativeValueException._Exception: (etype, eobj, etb) = sys.exc_info() # eobj is the SIDL exception object print eobj.exception.getNote() # show the exception comment print eobj.exception.getTrace() # and traceback
Note that eobj.exception is an instance of ExceptionTest.NegativeValueException.NegativeValueException, the Python type corresponding to the SIDL type ExceptionTest.NegativeValueException.