Skip to content

Commit

Permalink
return old exception if remote_exception fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Dec 29, 2015
1 parent 09a75c1 commit c2002b8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions dask/async.py
Expand Up @@ -580,9 +580,13 @@ def remote_exception(exc, tb):
""" Metaclass that wraps exception type in RemoteException """
if type(exc) in exceptions:
typ = exceptions[type(exc)]
return typ(exc, tb)
else:
typ = type(exc.__class__.__name__,
(RemoteException, type(exc)),
{'exception_type': type(exc)})
exceptions[type(exc)] = typ
return typ(exc, tb)
try:
typ = type(exc.__class__.__name__,
(RemoteException, type(exc)),
{'exception_type': type(exc)})
exceptions[type(exc)] = typ
return typ(exc, tb)
except TypeError:
return exc

0 comments on commit c2002b8

Please sign in to comment.