-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added error logging and error messaging response when errors occur #267
Added error logging and error messaging response when errors occur #267
Conversation
This also closes the graphql-java-kickstart/graphql-spring-boot#455 With this code change, I now receive the proper error feedback on all channels: CLI:
Notice the error seems duplicate, but in reality, this block in my code is now working as intended:
Also, on GraphQL response:
|
… any reason. Also fixed bug on JSON processing exception that was not being properly reported
Last commit now fixes 2 problems: 1- Any Json related problem on decoding the incoming message would mean a crash on 2- Whenever the connection init failed, the connection error was not providing any meaningful information. This now adds an error log displaying the exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
@oliemansm please let me know if there's anything I can assist here. |
@@ -23,7 +23,7 @@ public void accept(String request) { | |||
SubscriptionCommand command = commandProvider.getByType(message.getType()); | |||
command.apply(session, message); | |||
} catch (JsonProcessingException e) { | |||
log.error("Cannot read subscription command '{}'", request, e); | |||
log.error("Cannot read subscription command '{}': {}", request, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add the : {}
part here? Since the way it was worked just fine letting it print the stack trace.
@@ -19,6 +19,7 @@ public void apply(SubscriptionSession session, OperationMessage message) { | |||
connectionListeners.forEach(it -> it.onConnect(session, message)); | |||
session.sendMessage(new OperationMessage(Type.GQL_CONNECTION_ACK, message.getId(), null)); | |||
} catch (Throwable t) { | |||
log.error("Cannot initialize subscription command '{}': {}", message, t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add the : {}
part here? Since the way it was worked just fine letting it print the stack trace.
Att @vojtapol