foundation.cmo.api.mls.graphql.autoconfigure.MGraphQLException Maven / Gradle / Ivy
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;
}
}