Interface HandlerDataFetcherExceptionResolver
- All Superinterfaces:
DataFetcherExceptionResolver
Extension of
DataFetcherExceptionResolver with overloaded method to
apply at the point of DataFetcher invocation to allow local exception handling.- Since:
- 1.3.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptiondefault reactor.core.publisher.Mono<List<GraphQLError>>resolveException(Throwable exception, DataFetchingEnvironment environment) Resolve the given exception and return the error(s) to add to the response.reactor.core.publisher.Mono<List<GraphQLError>>resolveException(Throwable ex, DataFetchingEnvironment environment, Object handler) Resolve an exception raised by the given handler.
-
Method Details
-
resolveException
default reactor.core.publisher.Mono<List<GraphQLError>> resolveException(Throwable exception, DataFetchingEnvironment environment) Description copied from interface:DataFetcherExceptionResolverResolve the given exception and return the error(s) to add to the response.Implementations can use
GraphqlErrorBuilder.newError(DataFetchingEnvironment)to create an error with the coordinates of the target field, and useErrorTypeto specify a category for the error.- Specified by:
resolveExceptionin interfaceDataFetcherExceptionResolver- Parameters:
exception- the exception to resolveenvironment- the environment for the invokedDataFetcher- Returns:
- a
Monowith errors to add to the GraphQL response; if theMonocompletes with an empty List, the exception is resolved without any errors added to the response; if theMonocompletes empty, without emitting a List, the exception remains unresolved and that allows other resolvers to resolve it.
-
resolveException
reactor.core.publisher.Mono<List<GraphQLError>> resolveException(Throwable ex, DataFetchingEnvironment environment, @Nullable Object handler) Resolve an exception raised by the given handler.- Parameters:
ex- the exception to resolveenvironment- the environment for the invokedDataFetcherhandler- the handler that raised the exception, if applicable- Returns:
- a
Monowith resolvedGraphQLErrors as specified inDataFetcherExceptionResolver.resolveException(Throwable, DataFetchingEnvironment)
-