All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.infomaximum.cluster.graphql.executor.datafetcher.GDataFetcherExceptionHandler Maven / Gradle / Ivy

The newest version!
package com.infomaximum.cluster.graphql.executor.datafetcher;

import graphql.ExceptionWhileDataFetching;
import graphql.execution.DataFetcherExceptionHandler;
import graphql.execution.DataFetcherExceptionHandlerParameters;
import graphql.execution.DataFetcherExceptionHandlerResult;
import graphql.execution.ResultPath;
import graphql.language.SourceLocation;

public class GDataFetcherExceptionHandler implements DataFetcherExceptionHandler {

    @Override
    public DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters) {
        Throwable exception = handlerParameters.getException();
        SourceLocation sourceLocation = handlerParameters.getSourceLocation();
        ResultPath path = handlerParameters.getPath();

        ExceptionWhileDataFetching error = new ExceptionWhileDataFetching(path, exception, sourceLocation);
        handlerException(exception);
        return DataFetcherExceptionHandlerResult.newResult().error(error).build();
    }

    public void handlerException(Throwable exception) {
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy