示例#1
0
文件: execute.py 项目: bfirsh/celery
 def execute_safe(self, *args, **kwargs):
     try:
         return self.execute(*args, **kwargs)
     except Exception, exc:
         type_, value_, tb = sys.exc_info()
         exc = default_backend.prepare_exception(exc)
         warnings.warn("Exception happend outside of task body: %s: %s" % (
             str(exc.__class__), str(exc)))
         return ExceptionInfo((type_, exc, tb))
示例#2
0
def catch_exception(exception):
    try:
        raise exception
    except exception.__class__, exc:
        exc = default_backend.prepare_exception(exc)
        return exc, ExceptionInfo(sys.exc_info()).traceback
def catch_exception(exception):
    try:
        raise exception
    except exception.__class__, exc:
        exc = default_backend.prepare_exception(exc)
        return exc, ExceptionInfo(sys.exc_info()).traceback