Exemplo n.º 1
0
 def func_wrapper(calling_obj, *args, **kwargs):
     try:
         return func(calling_obj, *args, **kwargs)
     except EnvironmentError as error:
         exception_tuple = sys.exc_info()
         try:
             future = (calling_obj.handle
                       if hasattr(calling_obj, "handle") else calling_obj)
             errmsg = raw.flux_future_error_string(future)
         except EnvironmentError:
             six.reraise(*exception_tuple)
         if errmsg is None:
             six.reraise(*exception_tuple)
         raise EnvironmentError(error.errno, errmsg.decode("utf-8"))
Exemplo n.º 2
0
 def func_wrapper(calling_obj, *args, **kwargs):
     try:
         return func(calling_obj, *args, **kwargs)
     except EnvironmentError as error:
         try:
             future = (calling_obj.handle
                       if hasattr(calling_obj, "handle") else calling_obj)
             errmsg = raw.flux_future_error_string(future)
         except EnvironmentError:
             raise error from None
         if errmsg is None:
             raise error from None
         raise EnvironmentError(error.errno,
                                errmsg.decode("utf-8")) from None
Exemplo n.º 3
0
 def func_wrapper(calling_obj, *args, **kwargs):
     try:
         return func(calling_obj, *args, **kwargs)
     except EnvironmentError as error:
         exception_tuple = sys.exc_info()
         try:
             future = (
                 calling_obj.handle
                 if hasattr(calling_obj, "handle")
                 else calling_obj
             )
             errmsg = raw.flux_future_error_string(future)
         except EnvironmentError:
             six.reraise(*exception_tuple)
         if errmsg is None:
             six.reraise(*exception_tuple)
         raise EnvironmentError(error.errno, errmsg.decode("utf-8"))