Skip to content

Commit 5e07998

Browse files
Added support to show errors when connection initialization fails for any reason. Also fixed bug on JSON processing exception that was not being properly reported
1 parent f6d2665 commit 5e07998

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 9.2.1-SNAPSHOT
1+
version = 9.2.1.001-SNAPSHOT
22
group = com.graphql-java-kickstart
33

44
PROJECT_NAME = graphql-java-servlet

graphql-java-kickstart/src/main/java/graphql/kickstart/execution/subscriptions/apollo/ApolloSubscriptionConsumer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void accept(String request) {
2323
SubscriptionCommand command = commandProvider.getByType(message.getType());
2424
command.apply(session, message);
2525
} catch (JsonProcessingException e) {
26-
log.error("Cannot read subscription command '{}'", request, e);
26+
log.error("Cannot read subscription command '{}': {}", request, e);
2727
session.sendMessage(new OperationMessage(Type.GQL_CONNECTION_ERROR, null, e.getMessage()));
2828
}
2929
}

graphql-java-kickstart/src/main/java/graphql/kickstart/execution/subscriptions/apollo/SubscriptionConnectionInitCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public void apply(SubscriptionSession session, OperationMessage message) {
1919
connectionListeners.forEach(it -> it.onConnect(session, message));
2020
session.sendMessage(new OperationMessage(Type.GQL_CONNECTION_ACK, message.getId(), null));
2121
} catch (Throwable t) {
22+
log.error("Cannot initialize subscription command '{}': {}", message, t);
2223
session.sendMessage(new OperationMessage(Type.GQL_CONNECTION_ERROR, message.getId(), t.getMessage()));
2324
}
2425
}

0 commit comments

Comments
 (0)