Skip to content

failed to close WebSocket: received header with unexpected rsv bits set: true:true:true #519

Open
@switchupcb

Description

@switchupcb

What is the error type of this error so I can ignore it?

Here is an example of an error type within this library.

closeErr := new(websocket.CloseError)
if errors.As(err, closeErr) {
...
}

websocket.CloseError is an error type within this library.

So, what error type is returned when you receive the error failed to close WebSocket: received header with unexpected rsv bits set: true:true:true?

Activity

mafredri

mafredri commented on Feb 20, 2025

@mafredri
Member

Currently there's no specific error type when this happens, it's a plain fmt.Errorf error. Could you share a bit more context as to why this is happening and why you consider the error to be OK to ignore?

switchupcb

switchupcb commented on Feb 21, 2025

@switchupcb
Author

Could you share a bit more context as to why this is happening and why you consider the error to be OK to ignore?
@mafredri

This error happens when you attempt to close a connected websocket.

Here is the code that causes this error (when the error is not ignored).

disconnect() closes a websocket: https://github.com/switchupcb/disgo/blob/v10/wrapper/session_routine_manager.go#L267

disconnect() definition: https://github.com/switchupcb/disgo/blob/v10/wrapper/session_routine_manager_actions.go#L298

It is OK to ignore because my code works when I ignore it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      failed to close WebSocket: received header with unexpected rsv bits set: true:true:true · Issue #519 · coder/websocket