예제 #1
0
def peel_handler_exception(meth):
    try:
        return meth()
    except HandlerException, he:
        cause = he.cause
        t = getattr(cause, "type", cause.__class__)
        info = sys.exc_info()
        _compat.raise_(t, cause, info[2]) 
예제 #2
0
 def put(self, putter, v):
   """More informative exception from putters, include bad value"""
   try:
     putter(v)
   except Exception:
     etype, value, trace = sys.exc_info()
     raise_(etype, etype("%s(%r): %s" % (putter.__name__, v, value)), trace)
   return putter
예제 #3
0
def peel_handler_exception(meth):
    try:
        return meth()
    except HandlerException, he:
        cause = he.cause
        t = getattr(cause, "type", cause.__class__)
        info = sys.exc_info()
        _compat.raise_(t, cause, info[2])
예제 #4
0
def peel_handler_exception(meth):
    try:
        return meth()
    except HandlerException, he:
        cause = he.cause
        if hasattr(cause, "value"):
            cause = cause.value
        t = type(cause)
        info = sys.exc_info()
        _compat.raise_(t, cause, info[2])