-
Notifications
You must be signed in to change notification settings - Fork 189
Open
Labels
Description
When using the 'legacy' handler, I can send custom errors from on_connect as documented, because of the special Handling of WebSocketConnectionError at
ariadne/ariadne/asgi/handlers/graphql_ws.py
Lines 250 to 251 in a9cca4f
| if isinstance(error, WebSocketConnectionError): | |
| payload = error.payload # pylint: disable=no-member |
The same special handling is missing from GraphQLTransportWSHandler
ariadne/ariadne/asgi/handlers/graphql_transport_ws.py
Lines 226 to 228 in a9cca4f
| 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.
Reactions are currently unavailable