@PublicApi public class SimpleDataFetcherExceptionHandler extends java.lang.Object implements DataFetcherExceptionHandler
ExceptionWhileDataFetching error
into the error collection| Constructor and Description |
|---|
SimpleDataFetcherExceptionHandler() |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<DataFetcherExceptionHandlerResult> |
handleException(DataFetcherExceptionHandlerParameters handlerParameters)
When an exception occurs during a call to a
DataFetcher then this handler
is called to shape the errors that should be placed in the ExecutionResult.getErrors()
list of errors. |
protected void |
logException(ExceptionWhileDataFetching error,
java.lang.Throwable exception)
Called to log the exception - a subclass could choose to something different in logging terms
|
DataFetcherExceptionHandlerResult |
onException(DataFetcherExceptionHandlerParameters handlerParameters)
When an exception occurs during a call to a
DataFetcher then this handler
is called to shape the errors that should be placed in the ExecutionResult.getErrors()
list of errors. |
protected java.lang.Throwable |
unwrap(java.lang.Throwable exception)
Called to unwrap an exception to a more suitable cause if required.
|
public DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters)
DataFetcherExceptionHandlerDataFetcher then this handler
is called to shape the errors that should be placed in the ExecutionResult.getErrors()
list of errors.onException in interface DataFetcherExceptionHandlerhandlerParameters - the parameters to this callbackGraphQLErrorspublic java.util.concurrent.CompletableFuture<DataFetcherExceptionHandlerResult> handleException(DataFetcherExceptionHandlerParameters handlerParameters)
DataFetcherExceptionHandlerDataFetcher then this handler
is called to shape the errors that should be placed in the ExecutionResult.getErrors()
list of errors.handleException in interface DataFetcherExceptionHandlerhandlerParameters - the parameters to this callbackGraphQLErrorsprotected void logException(ExceptionWhileDataFetching error, java.lang.Throwable exception)
error - the graphql errorexception - the exception that happenedprotected java.lang.Throwable unwrap(java.lang.Throwable exception)
exception - the exception to unwrap