Consistent logging in annotated exception handler
This commit aligns DEBUG logging of exceptions resolved via annotated exception handler methods with ExceptionResolversExceptionHandler and the reference documentation. Closes gh-996
This commit is contained in:
@@ -238,7 +238,17 @@ final class AnnotatedControllerExceptionResolver implements HandlerDataFetcherEx
|
||||
|
||||
Object result = exceptionHandler.invoke(env, arguments);
|
||||
|
||||
return methodReturnValueAdapter.adapt(result, exception);
|
||||
Mono<List<GraphQLError>> errorsMono = methodReturnValueAdapter.adapt(result, exception);
|
||||
if (logger.isDebugEnabled()) {
|
||||
errorsMono = errorsMono.doOnNext((errors) -> {
|
||||
if (logger.isDebugEnabled()) {
|
||||
String name = exception.getClass().getSimpleName();
|
||||
logger.debug("Resolved " + name + " to GraphQL error(s): " + errors, exception);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return errorsMono;
|
||||
}
|
||||
catch (Throwable invocationEx) {
|
||||
// Any other than the original exception (or a cause) is unintended here,
|
||||
|
||||
Reference in New Issue
Block a user