Pylons/pyramid_debugtoolbar

renderers panel modification proposal

jvanasco opened this issue · 2 comments

We use a custom exception view to catch certain API errors, and return a formatted json document.

When running with the debugtoolbar enabled, the client is served the correct document from the exception view... however the traceback panel for the squashed exception only contains everything up until that exception is raised.

We can get that info from the renderers panel, but it's a bit awkward as the information is all over the place.

I've got things solved in a custom panel for now, but I'd like to propose either changing the renderers panel or adding a new "response" panel.

In the current "renderer" panel, the "System Values" section is alphabetical. I propose duplicating view and context to their own sections (like render name) above the table.

Suggest adding a screenshot of your custom panel to illustrate your proposal, if possible. I'm having a hard time visualizing this proposed change.

Below are the existing and suggested versions (i deleted the query strings from the request, as they had some local test API credentials)

The idea is to just highlight the View/Context info as that is the most useful information available from the 'system' info.

The other stuff is useful too. but it's largely available elsewhere or used for debugging the rendering action as they're the local vars. This is the only panel that says "we ultimately rendered this view".

For background...

  • The request and matched_route points to a view "manage_settings"
  • A permission check failed within the view, raising an ApiPermissionsError, which ultimately raised a ViewException_Permissions_JsonAPI error, which is used to trigger a view of...
  • The view exception_view__Permissions_JsonAPI is called to render a JSON doc.

existing

suggested