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:DataFetcherExceptionResolver
Resolve 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 useErrorType
to specify a category for the error.- Specified by:
resolveException
in interfaceDataFetcherExceptionResolver
- Parameters:
exception
- the exception to resolveenvironment
- the environment for the invokedDataFetcher
- Returns:
- a
Mono
with errors to add to the GraphQL response; if theMono
completes with an empty List, the exception is resolved without any errors added to the response; if theMono
completes 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 invokedDataFetcher
handler
- the handler that raised the exception, if applicable- Returns:
- a
Mono
with resolvedGraphQLError
s as specified inDataFetcherExceptionResolver.resolveException(Throwable, DataFetchingEnvironment)
-