General guidance on recommended error handling for servers #3915
Unanswered
LukasKalbertodt
asked this question in
Q&A
Replies: 1 comment
-
I think the answer is a big "it depends". Yea, some of them will be largely harmless, but reported nonetheless because we don't know if it might be important to you. But sometimes the error may indicate "bigger" problems. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
In hyper's official examples, a
hyper::Error
is handled like this:Which is fine for examples of course, but I wonder: what is a recommended & idiomatic way to handle these errors for a production server? I am looking for general guidance to understand when these errors occur, how critical they are and whether I can ignore them.
For example, I also just used to log these errors with
log::error!
, but I now encountered more and more cases where errors occur that don't seem to actually matter? For example, when I serve a video file with support forRange
requests, browsers often cancel requests (just close the connection). This results in a mix of:IncompleteMessage
hyper::Error(BodyWrite, Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" })
hyper::Error(Shutdown, Os { code: 107, kind: NotConnected, message: "Transport endpoint is not connected" })
But again, this is just an example, this discussion is about general guidance. Is it fine to just
log::trace!
these errors as they are only relevant to debug if something is actually not working?Beta Was this translation helpful? Give feedback.
All reactions