Package omero :: Package gateway :: Class OmeroGatewaySafeCallWrapper
[hide private]
[frames] | no frames]

Class OmeroGatewaySafeCallWrapper

source code


Function or method wrapper that handles certain types of server side exceptions and debugging of errors.

Instance Methods [hide private]
 
__init__(self, proxyObjectWrapper, attr, f)
Initialises the function call wrapper.
source code
 
debug(self, exc_class, args, kwargs) source code
 
handle_exception(self, e, *args, **kwargs)
Exception handler that is expected to be overridden by sub-classes.
source code
 
__call__(self, *args, **kwargs) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, proxyObjectWrapper, attr, f)
(Constructor)

source code 

Initialises the function call wrapper.

Parameters:
  • attr (String) - Function name
  • f (Function) - Function to wrap
Overrides: object.__init__

handle_exception(self, e, *args, **kwargs)

source code 

Exception handler that is expected to be overridden by sub-classes. The expected behaviour is either to handle a type of exception and return the server side result or to raise the already thrown exception. The calling context is an except block and the original *args and **kwargs from the wrapped function or method are provided to allow re-execution of the original.

Parameters:
  • e (Exception) - The exception that has already been raised.