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

dev_tools_prune_errors #860

Merged
merged 5 commits into from
Aug 11, 2019
Merged

dev_tools_prune_errors #860

merged 5 commits into from
Aug 11, 2019

Conversation

alexcjohnson
Copy link
Collaborator

Closes #843

Adds a new run_server / enable_dev_tools arg dev_tools_prune_errors that defaults to True. In that default case, tracebacks only include user code (and anything below it in the stack), excluding entries from Dash and Flask. Set it to False to revert to the current behavior of showing the complete stack.

@alexcjohnson alexcjohnson requested a review from byronz as a code owner August 10, 2019 02:05
@@ -15,22 +15,22 @@
"fail": True,
"name": 'missing required "value" inside options',
"component": dcc.Checklist,
"props": {"options": [{"label": "hello"}], "values": ["test"]},
"props": {"options": [{"label": "hello"}], "value": ["test"]},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what infuriates me about Percy... OK, here it's just a test problem, not a real bug, but the images were completely different from what they should have been, and got auto-approved, I assume, because the change came from DCC and so likely happened first in master.

skip = 0
for i, line in enumerate(tb.plaintext.splitlines()):
if "%% callback invoked %%" in line:
skip = int((i + 1) / 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the skip is about half of code to the callback stub? just curious about the algorithm

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plaintext traceback has 2 lines for each stack frame: first line lists the file, line #, and function; second line is the actual line of code. +1 gives the first line of the next pair - the first frame we want to report - then /2 gives the number of frames above it.

dash/dash.py Outdated Show resolved Hide resolved
Co-Authored-By: Byron Zhu <byronz@users.noreply.github.com>
Copy link
Contributor

@byronz byronz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@byronz byronz merged commit c17edc8 into master Aug 11, 2019
@byronz byronz deleted the 843-simple-errors branch August 11, 2019 00:04
HammadTheOne pushed a commit to HammadTheOne/dash that referenced this pull request May 28, 2021
…dlebars-4.7.6

Bump handlebars from 4.1.1 to 4.7.6
HammadTheOne pushed a commit that referenced this pull request Jul 23, 2021
…s-4.7.6

Bump handlebars from 4.1.1 to 4.7.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Simplified tracebacks in devtools
2 participants