Replies: 1 comment
-
Oh, I think I can just do The question still remains why it’s now |
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
-
Summary
I’ve recently moved a piece of WebSocket handling code from manual hyper + tungstenite to axum. Overall it was fairly easy and works as it did previously – but I’ve a slight problem with error handling.
Previously, when handling WS messages, we filtered out the connection reset by peer messages by checking for the error type, something along those lines:
now I just get dynamic
axum::Error
with the content:Error { inner: Io(Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }) }
.I see there’s a difference of the type of error too (IO error instead of tungstenite’s Protocol error) – not sure if that’s a difference from axum’s different use of the WS, or a change between tungstenite versions.
Anyway, is there a way to cast it down to the underlying error so that I’d be able to filter it out without stringifying it and checking for substrings like
ConnectionReset
? Having bazillion warning logs because proxy server somewhere times out our idle connections (which we do expect to happen, the client will reconnect if it needs to) is annoying (while we would like to catch other unexpected stuff happening to the WS).axum version
0.7.7
Beta Was this translation helpful? Give feedback.
All reactions