Trim tracebacks in Process._resume()

luensdorf avatarluensdorf created an issue

This is output of the example in issue #24:

Traceback (most recent call last):
  File "/home/thecom/src/simpy/simpy/core.py", line 434, in _resume
    next_evt = self._generator.send(value)
  File "/tmp/test.py", line 5, in a
    raise RuntimeError('fail')
RuntimeError: fail

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/thecom/src/simpy/simpy/core.py", line 439, in _resume
    next_evt = self._generator.throw(value)
  File "/tmp/test.py", line 8, in b
    yield env.start(a(env))
RuntimeError: fail

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/thecom/src/simpy/simpy/core.py", line 439, in _resume
    next_evt = self._generator.throw(value)
  File "/tmp/test.py", line 11, in c
    yield env.start(b(env))
RuntimeError: fail

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/tmp/test.py", line 15, in <module>
    simpy.simulate(env)
  File "/home/thecom/src/simpy/simpy/core.py", line 640, in simulate
    step(env)
  File "/home/thecom/src/simpy/simpy/core.py", line 604, in step
    raise value
RuntimeError: fail

The frames of _resume add no useful information and can be dropped. We should examine if removing the frame results in side-effects or heavy performance impacts.

Comments (6)

  1. luensdorf

    As discussed with Stefan, this won't get implemented. Although this information is redundant it describes what really is happening. Omitting parts of it could lead to very hard to debug problems.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.