Package graphql.execution
Interface DataFetcherExceptionHandler
-
- All Known Implementing Classes:
SimpleDataFetcherExceptionHandler
@PublicSpi public interface DataFetcherExceptionHandler
This is called when an exception is thrown duringDataFetcher.get(DataFetchingEnvironment)execution
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default java.util.concurrent.CompletableFuture<DataFetcherExceptionHandlerResult>handleException(DataFetcherExceptionHandlerParameters handlerParameters)When an exception occurs during a call to aDataFetcherthen this handler is called to shape the errors that should be placed in theExecutionResult.getErrors()list of errors.default DataFetcherExceptionHandlerResultonException(DataFetcherExceptionHandlerParameters handlerParameters)Deprecated.usehandleException(DataFetcherExceptionHandlerParameters)instead which as an asynchronous version
-
-
-
Method Detail
-
onException
@Deprecated default DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters)
Deprecated.usehandleException(DataFetcherExceptionHandlerParameters)instead which as an asynchronous versionWhen an exception occurs during a call to aDataFetcherthen this handler is called to shape the errors that should be placed in theExecutionResult.getErrors()list of errors.- Parameters:
handlerParameters- the parameters to this callback- Returns:
- a result that can contain custom formatted
GraphQLErrors
-
handleException
default java.util.concurrent.CompletableFuture<DataFetcherExceptionHandlerResult> handleException(DataFetcherExceptionHandlerParameters handlerParameters)
When an exception occurs during a call to aDataFetcherthen this handler is called to shape the errors that should be placed in theExecutionResult.getErrors()list of errors.- Parameters:
handlerParameters- the parameters to this callback- Returns:
- a result that can contain custom formatted
GraphQLErrors
-
-