Last active
August 29, 2015 14:08
-
-
Save erikrose/154dd6c944ca7e0836ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def full_traceback(callable, *args, **kwargs): | |
"""Work around the wretched exception reporting of concurrent.futures. | |
Futures generally gives no access to the traceback of the task; you get | |
only a traceback into the guts of futures, plus the description line of | |
the task's traceback. We jam the full traceback of any exception that | |
occurs into the message of the exception: disgusting but informative. | |
""" | |
try: | |
return callable(*args, **kwargs) | |
except Exception: | |
raise Exception(format_exc()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example use:
…becomes…