Recoverable Error Handling #33
rowanmanning
started this conversation in
Planning
Replies: 1 comment
-
I llike the idea of the request as optional parameter |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to do a bit of a brain dump about recoverable error handling so that if anyone has thoughts they can contribute while I'm away (and also I will forget everything between now and July if I don't write it down).
I think we need to add in a package for handling recoverable errors (aka silenced errors) where the app can continue to render a page even if an error occurs. E.g. if an API fails then part of the page is not rendered but the end user still gets a
200
status code and a partially complete page.Currently our logs for these kinds of errors are just as inconsistent as our standard error logging. Technically engineers on our teams can now produce quite detailed logs like this:
However this is quite a lot of boilerplate, and could easily lead to inconsistency (e.g. if people decide to change
event
on a per-route basis or if they forget to include therequest
details in some places). It would also be easy to mix upwarn
anderror
for these cases resulting in more inconsistency.I think maybe we should provide something like this in order to codify the format and make sure that recoverable errors are logged in the same way as unrecoverable errors:
In this example,
request
could be an optional parameter so that we also cater for non-HTTP contexts. I think this will result in more consistency going forward and the method name is really explicit and it's clear what it's for.Beta Was this translation helpful? Give feedback.
All reactions