Skip to content

No way to send custom error from on_connect when using GraphQLTransportWSHandler #1122

Open
@vlaci

Description

@vlaci

When using the 'legacy' handler, I can send custom errors from on_connect as documented, because of the special Handling of WebSocketConnectionError at

if isinstance(error, WebSocketConnectionError):
payload = error.payload # pylint: disable=no-member

The same special handling is missing from GraphQLTransportWSHandler

except Exception as error:
log_error(error, self.logger)
await websocket.close()

It would be nice if at least the error code could be overridden to signal authorization errors to the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions