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

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

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

import java.util.Collections;
import java.util.List;

import graphql.ErrorClassification;
import graphql.ErrorType;
import graphql.GraphQLError;
import graphql.language.SourceLocation;

public class MGraphQLException implements GraphQLError {

	private static final long serialVersionUID = 1L;
	
    private final String message;
    private final List locations;

	
	public MGraphQLException(Throwable exception, SourceLocation sourceLocation) {
        this.locations = Collections.singletonList(sourceLocation);
        this.message = exception.getMessage();
	}
	
	public MGraphQLException() {
		this(null, null);
	}

	@Override
	public String getMessage() {
		return message;
	}

	@Override
	public List getLocations() {
		return this.locations;
	}

	@Override
	public ErrorClassification getErrorType() {
        return ErrorType.DataFetchingException;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy