-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
- I've searched for any related issues and avoided creating a duplicate issue.
Description
When ws throws errors due to received content, it associates a websocket status code with them, which specifies the status code that will be sent when closing the connection.
It attaches this to the error behind a symbol called kStatusCode (used here, defined here), keeping that status code as internal private state that can't be easily or reliably accessed by application code.
That is inconvenient, because in some cases this is useful information for applications too, e.g. to tracking metrics of websocket failure reasons, or to implement various advanced error handling scenarios that depend on type of protocol failure involved.
Would you be open to making this a non-symbol property, so it's available as a reliable part of the API for error handling?