Refactor: Improves readability and modularity.
We're using Frisby.js. In our own project we monkey patched DebugExceptions#render_exception to return a JSON response which includes the stacktrace, it makes debug easier.
With this extraction you'll only have to override the logic that actually renders the HTML.
extract render detailed exception in own method
doc for DebugExceptions#render_detailed_exception
I like that idea. 👍
I'd push it a bit further though, as right now we'd need to rewrite the entire method.
How about having other methods for retrieving the template, and rendering in html and json?
A bit like what we already do with responders in to_html and to_format.
Also, as this would become public API, it will need a changelog entry and to be documented.
Merge branch 'master' into patchable_exceptions
handle exceptions in own class (will log the exception, render it or …
@dmathieu thanks and sorry I didn't follow up, I'll keep an eye one this from now on.
I implemented a solution that handles the exception in a throw away class
There's currently 1 failing test, if you think there's any value in that branch I'll fix it, if not, please let me know how it's different from what you had in mind and I'll amend accordingly.