Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log chained exceptions #1396

Merged
merged 3 commits into from Dec 6, 2018
Merged

log chained exceptions #1396

merged 3 commits into from Dec 6, 2018

Conversation

@eltonlaw
Copy link
Contributor

@eltonlaw eltonlaw commented Nov 13, 2018

fixes #1350

@eltonlaw
Copy link
Contributor Author

@eltonlaw eltonlaw commented Nov 14, 2018

example
Here's how it looks right now (using Flask)

@davidism
Copy link
Member

@davidism davidism commented Nov 21, 2018

There's still some issues here. It looks like we don't want to use chain=True in exception, since that sticks the whole traceback at the top and bottom of the page, instead of just the exception. Instead, we want to make plaintext understand the chained exceptions.

Started digging into this and basically we need to create groups of frames and let them handle the formatting. Python actually has a similar idea, but it's in 3.5+ only. I'm working on it.

@davidism davidism added this to the 0.15 milestone Nov 21, 2018
@davidism
Copy link
Member

@davidism davidism commented Dec 6, 2018

Rebased your original commmit, then made changes as described in the previous comment. Did a bunch of compat cleanup in tbtools too.

A lot of the processing moved from Traceback to the new Group object. Made the style for the chain info message look like the "Traceback (most recent call last)` header.

screen shot 2018-12-06 at 08 12 10
screen shot 2018-12-06 at 08 13 50

@davidism
Copy link
Member

@davidism davidism commented Dec 6, 2018

Turns out that frame.f_lineno is not accurate (at least in chained exceptions), and traceback.tb_lineno should be used instead. I could not find an explanation for this difference.

davidism added 2 commits Dec 6, 2018
revert to showing only exception at top and bottom
add render_text method
don't prepend module for "builtins"
remove handling for unsupported "raise string"
use property as decorator
use to_unicode and text_type compat
@davidism davidism merged commit 8c97708 into pallets:master Dec 6, 2018
1 check passed
davidism added a commit that referenced this issue Dec 6, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants