def _encode_exception(reply): if isinstance(reply, InstrumentException): # InstrumentExceptions have corresponding IonException error code built-in return reply.get_triple() else: # all others are wrapped to capture stack and appropriate code ex = UnexpectedError("%s('%s')" % (reply.__class__.__name__, reply.message)) return ex.get_triple()
def encode_exception(exception): if not isinstance(exception, InstrumentException): exception = UnexpectedError( "%s('%s')" % (exception.__class__.__name__, exception.message)) return exception.get_triple()
def encode_exception(exception): if not isinstance(exception, InstrumentException): exception = UnexpectedError("%s('%s')" % (exception.__class__.__name__, exception.message)) return exception.get_triple()