You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was looking at the code, and it seems WebSocket original exception that happen when mapping the payload to gql message are "swallowed". On client, we just see a generic: Subscription error. This makes it almost impossible to debug, but also notice issues with messages.
Indeed we should be logging an unresolved exception at that point. We'll fix that. Note that you can handle subscription exceptions, or if it is a controller method, you can also use an @GraphQlExceptionHandler method.
rstoyanchev
changed the title
WebSocket errors swallowed
WebSocket handlers should log unhandled errors
Feb 17, 2025
Was looking at the code, and it seems WebSocket original exception that happen when mapping the payload to gql message are "swallowed". On client, we just see a generic:
Subscription error
. This makes it almost impossible to debug, but also notice issues with messages.Looking at the code, this seems to happen here:
https://github.com/spring-projects/spring-graphql/blob/main/spring-graphql/src/main/java/org/springframework/graphql/server/webmvc/GraphQlWebSocketHandler.java#L350
There should be an option to log an error here, this is an uncaught exception basically.
The text was updated successfully, but these errors were encountered: