Skip to content

[Feature Request] Simplified tracebacks in devtools #843

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

Closed
alexcjohnson opened this issue Jul 29, 2019 · 0 comments · Fixed by #860
Closed

[Feature Request] Simplified tracebacks in devtools #843

alexcjohnson opened this issue Jul 29, 2019 · 0 comments · Fixed by #860
Assignees
Milestone

Comments

@alexcjohnson
Copy link
Collaborator

alexcjohnson commented Jul 29, 2019

Currently devtools provides extremely long tracebacks when there's an error in a callback. They look something like this:

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dash/dash.py", line 1287, in dispatch
    response.set_data(self.callback_map[output]['callback'](*args))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dash/dash.py", line 1171, in add_context
    output_value = func(*args, **kwargs)
  File "/Users/alex/plotly/dash-dev/agricultural_exports/agricultural_exports.py", line 58, in update_graph
    raise ValueError('boo')
ValueError: boo

Normally an app developer is only interested in the part in their own code (the last entry above, but could be more if their code was more involved). Even dash core devs wouldn't normally care about anything above the two extra dash entries, though @bpostlethwaite claims to have had to chase something through the flask stack in the past.

I'd propose an option like dev_tools_short_tracebacks with a default True, so normally all that shows up is the app code, but if necessary you can set it False and see it in all the current gory detail.

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 a pull request may close this issue.

2 participants