-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
It's more likely that a user will run into a 500 error where they request a panel id that doesn't exist now that we can persist the toolbar's store. I've run into this locally in my own testing a few times, but couldn't come up with a reproducible pattern.
Relevant code:
panel = toolbar.get_panel_by_id(request.GET["panel_id"]) |
Traceback
ERROR Internal Server Error: /__debug__/render_panel/
Traceback (most recent call last):
File "/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/site-packages/sentry_sdk/integrations/django/views.py", line 94, in sentry_wrapped_callback
return callback(request, *args, **kwargs)
File "/site-packages/debug_toolbar/decorators.py", line 34, in inner
return view(request, *args, **kwargs)
File "/site-packages/debug_toolbar/decorators.py", line 46, in inner
return view(request, *args, **kwargs)
File "/site-packages/debug_toolbar/views.py", line 24, in render_panel
panel = toolbar.get_panel_by_id(request.GET["panel_id"])
File "/site-packages/debug_toolbar/toolbar.py", line 79, in get_panel_by_id
return self._panels[panel_id]
~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'ProfilingPanel'
I suspect we may want to add a custom exception here when an invalid panel is requested to make it easier for an API integration to be built on top of Toolbar
.
Metadata
Metadata
Assignees
Labels
No labels