예제 #1
0
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()
예제 #2
0
def encode_exception(exception):
    if not isinstance(exception, InstrumentException):
        exception = UnexpectedError(
            "%s('%s')" % (exception.__class__.__name__, exception.message))
    return exception.get_triple()
예제 #3
0
def encode_exception(exception):
    if not isinstance(exception, InstrumentException):
        exception = UnexpectedError("%s('%s')" % (exception.__class__.__name__, exception.message))
    return exception.get_triple()