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

foundation.cmo.api.mls.graphql.autoconfigure.MGraphQLExceptionHandler Maven / Gradle / Ivy

There is a newer version: 1.0.21
Show newest version
package foundation.cmo.api.mls.graphql.autoconfigure;

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

public class MGraphQLExceptionHandler implements DataFetcherExceptionHandler {
	@Override
	public DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters) {
		Throwable exception = handlerParameters.getException();
		SourceLocation sourceLocation = handlerParameters.getSourceLocation();
		MGraphQLException error = new MGraphQLException(exception, sourceLocation);

		return DataFetcherExceptionHandlerResult.newResult().error(error).build();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy