celery.backends.base
The base backend class. All backends should inherit from this.
Wait for task and return its result.
If the task raises an exception, this exception will be re-raised by wait_for().
If timeout is not None, this raises the celery.timer.TimeoutError exception if the operation takes longer than timeout seconds.
Wraps unpickleable exceptions.
Parameters: |
|
---|
Example
>>> try:
... something_raising_unpickleable_exc()
>>> except Exception, e:
... exc = UnpickleableException(e.__class__.__module__,
... e.__class__.__name__,
... e.args)
... pickle.dumps(exc) # Works fine.
With an exception instance, iterate over its super classes (by mro) and find the first super exception that is pickleable. It does not go below Exception (i.e. it skips Exception, BaseExecption and object). If that happens you should use UnpickleableException instead.
Parameter: | exc – An exception instance. |
---|---|
Returns: | the nearest exception if it’s not Exception or below, if it is it returns None. |
Return type: | Exception |