ethereum / asyncio-run-in-process

A simple asyncio friendly replacement for multiprocessing to run coroutines in a separate process.
MIT License
13 stars 9 forks source link

Preserve remote tracebacks #3

Closed pipermerriam closed 5 years ago

pipermerriam commented 5 years ago

What was wrong?

When something goes wrong in the subprocess the returned exception loses most of it's context as it gets re-raised.

How was it fixed?

Used the pattern found here:

https://github.com/ethereum/trinity/blob/992226b5036448b3e30f9638a6da73d1471e5a98/trinity/_utils/mp.py#L56-L81

Exceptions are wrapped and their tracebacks are stringified. When the exception is re-raised on the other side it now containes the preserved traceback information from the child process.

I also added a DEBUG log level printing of the exception info.

Cute Animal Picture

119