inducer / inducer/pudb

Show chained exceptions in the stack in exception handling mode

Open
#335 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.2k
Forks
245
Avg merge
13m
Merged PRs (30d)
5

Description

Kind of surprised this hasn't come up before. Take for example:

```py
def test():
try:
test2()
except:
raise ValueError("Chained exception")

def test2():
raise RuntimeError("First exception")

import pudb; pudb.set_trace()

test()
```

If you run over test, then go to the location of the exception, you can only go to the `ValueError` in the stack. You can't move up to the `RuntimeError`. Note that this would only work in Python 3, because Python 2 doesn't keep track of chained exceptions.

Ideally the stack should treat each chained exception as a higher stack frame, perhaps with some kind of marker to indicate the frames where an exception is raised.

I've no idea how hard this is to fix.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the exception-handling mode and stack navigation exercised by the test() and test2() example after pudb.set_trace(). Check how Python 3 chained exceptions are represented and how the current stack selects the ValueError. Done means the chained RuntimeError is navigable as an additional higher frame, with a marker distinguishing exception-raised frames.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.