Provide a JSON view of the error info page #227
Labels
enhancement
New feature or request
package: middleware-render-error-info
Relates to the middleware-render-error-info package
requested
Used to indicate that a team outside of the maintainers of this repo has requested this work
Currently the error info page is only viewable as HTML. We should consider adding a JSON-based view.
What problem does this feature solve?
For JSON-based APIs, an HTML error page doesn't make a lot of sense, especially when most local development is done using
curl
or Postman. In these cases it's actually unhelpful to have an HTML-based error page.Ideal solution
We allow for apps to configure the error info page to output the data as JSON instead of HTML. Something like this:
Alternatives
We could do nothing. Maybe this isn't actually a use-case we need to consider? If an app is JSON-based then it's likely (it should be) already handling errors and responding with a JSON representation.
Instead of complicating the error debug page, maybe we provide a separate production-ready JSON-based error handler which. This would require us deciding on a single standard for JSON-based errors which works for all our apps.
See also
CPREL-322
The text was updated successfully, but these errors were encountered: