pyramid_debugtoolbar icon indicating copy to clipboard operation
pyramid_debugtoolbar copied to clipboard

proprosal: safe panel invocations

Open jvanasco opened this issue 5 years ago • 1 comments

Under the current toolbar design, if an error occurs in a debug panel or panel rendering, a generic wsgi error is generated.

I propose wrapping the invocations of various panel API methods in a try/except block. If an error is raised it is either tracked on the toolbar or the panel via a new attribute .is_panel_error or similar. it is logged at an log.ERROR level too. the html for broken panels is replaced with a 'error in the panel' message.

thoughts? this would require adding a new panel attribute or some code to track broken panels, so I wanted to discuss before trying a PR.

jvanasco avatar Apr 30 '19 18:04 jvanasco

I would not extend the panel itself to track this... it's like asking something to track its own failure... then why didn't it just do the right thing in the first place if it thought it was going to fail? The toolbar could be updated to track broken panels. If it's done cleanly I'm not against merging some support for it.

mmerickel avatar May 01 '19 05:05 mmerickel