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
Do not rewrap CompletionException in DataFetcher instrumentation
This commit ensures that, when an instrumented DataFetcher returns a
`CompletionException`, we do not re-wrap it with the same exception
type. This aligns with the behavior enforced in the JDK
`CompletableFuture`.
Fixesgh-780
Copy file name to clipboardExpand all lines: spring-graphql/src/main/java/org/springframework/graphql/observation/GraphQlObservationInstrumentation.java
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -147,9 +147,15 @@ public DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher,
147
147
returncompletion.handle((result, error) -> {
148
148
observationContext.setValue(result);
149
149
if (error != null) {
150
-
dataFetcherObservation.error(error);
151
-
dataFetcherObservation.stop();
152
-
thrownewCompletionException(error);
150
+
if (errorinstanceofCompletionExceptioncompletionException) {
Copy file name to clipboardExpand all lines: spring-graphql/src/test/java/org/springframework/graphql/observation/GraphQlObservationInstrumentationTests.java
0 commit comments