# Interested in support to jump between chained exception in Pdb

**URL:** <https://discuss.python.org/t/interested-in-support-to-jump-between-chained-exception-in-pdb/29470>\
**Category:** Ideas\
**Created:** [July 11, 2023, 1:14pm UTC](https://discuss.python.org/t/interested-in-support-to-jump-between-chained-exception-in-pdb/29470 "2023-07-11T13:14:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbussonn](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/mbussonn/32/112_2.png) [@mbussonn](https://discuss.python.org/u/mbussonn)\
**Post date:** [July 11, 2023, 1:14pm UTC](https://discuss.python.org/t/interested-in-support-to-jump-between-chained-exception-in-pdb/29470/1 "2023-07-11T13:14:24Z")

</div>

Is there any interest/plan for chained exception in Pdb ?  
That is to say if you have

```python
try:
   function_that_raises()
except Exception as e:
   raise ... from e # Pdb says this is the bottom frame.

```

Havin something like `down` go down the chained exception ? This was requested on [IPython’s ipdb](https://github.com/ipython/ipython/issues/13982), But I believe this could be brought to Pdb as well.

## How

When moving up and down the stack in Pdb in chained exception, when hitting the bottom of the stack, it should be possible to look at the ` __cause__ ` or ` __context__ ` and jump to the top of it. And vice-versa when going up if we store the various TB we went through.

In post-mortem debugging this should allow to better understand the reason for an exception.

I believe up/down are fairly natural commands to do so, but open to other ways.

---

<div class="post-metadata">

**Author:** ![guido](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/guido/32/21_2.png) [@guido](https://discuss.python.org/u/guido)\
**Post date:** [July 11, 2023, 7:28pm UTC](https://discuss.python.org/t/interested-in-support-to-jump-between-chained-exception-in-pdb/29470/2 "2023-07-11T19:28:54Z")

</div>

I’m too tired to help, but in principle this sounds like a useful thing to add. Go for it!

---

<div class="post-metadata">

**Author:** ![mbussonn](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/mbussonn/32/112_2.png) [@mbussonn](https://discuss.python.org/u/mbussonn)\
**Post date:** [July 12, 2023, 8:18am UTC](https://discuss.python.org/t/interested-in-support-to-jump-between-chained-exception-in-pdb/29470/3 "2023-07-12T08:18:53Z")

</div>

Thanks you very much for the feedback. I believe I should be able to manage at least a POC and a PR by myself.

I will open [an issue](https://github.com/python/cpython/issues/106670) on the GH bug tracker, and start working [on a PR](https://github.com/python/cpython/pull/106676).
