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

Conversation

Projects
None yet
2 participants
@eltonlaw
Copy link
Contributor

commented Nov 13, 2018

fixes #1350

@eltonlaw eltonlaw force-pushed the eltonlaw:master branch from 013601d to 1d0c46a Nov 14, 2018

@eltonlaw

This comment has been minimized.

Copy link
Contributor Author

commented Nov 14, 2018

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

@davidism

This comment has been minimized.

Copy link
Member

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 davidism force-pushed the eltonlaw:master branch from 1d0c46a to 44c754e Dec 6, 2018

@davidism

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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 some commits Dec 5, 2018

group frames by exception
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 force-pushed the eltonlaw:master branch from 44c754e to a750ec9 Dec 6, 2018

@davidism davidism merged commit 8c97708 into pallets:master Dec 6, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

davidism added a commit that referenced this pull request Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.