cknd / stackprinter

Debugging-friendly exceptions for Python
MIT License
1.28k stars 37 forks source link

Option to include the outer stack frames as well? #26

Closed kbirk closed 3 years ago

kbirk commented 4 years ago

Pythons seems to only include the inner stack frames when you handle an exception, the following article outlines a way to acquire the outer frames as well.

http://blog.dscpl.com.au/2015/03/generating-full-stack-traces-for.html

It would be a really great option feature to include in this lib.

cknd commented 4 years ago

I built a slightly hacked-together implementation of this here: https://github.com/cknd/stackprinter/pull/27 . Can you clone / check out that branch and use it a little to see how it fits your use case? I called the new option add_prior_calls (debatable naming)

kbirk commented 4 years ago

Thanks for the response. I just tried the branch out and I get a stack overflow when I set add_prior_calls=True.

cknd commented 4 years ago

Huh, that's very odd. Can you please post the output you got, as well as some example code that allows me to reproduce the error?