graphql.execution.AbortExecutionException Maven / Gradle / Ivy
package graphql.execution;
import graphql.ErrorType;
import graphql.GraphQLError;
import graphql.GraphQLException;
import graphql.PublicApi;
import graphql.language.SourceLocation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static graphql.Assert.assertNotNull;
import static java.util.Collections.emptyList;
/**
* This Exception indicates that the current execution should be aborted.
*/
@PublicApi
public class AbortExecutionException extends GraphQLException implements GraphQLError {
private final List underlyingErrors;
public AbortExecutionException() {
this.underlyingErrors = emptyList();
}
public AbortExecutionException(Collection underlyingErrors) {
this.underlyingErrors = new ArrayList<>(assertNotNull(underlyingErrors));
}
public AbortExecutionException(String message) {
super(message);
this.underlyingErrors = emptyList();
}
public AbortExecutionException(String message, Throwable cause) {
super(message, cause);
this.underlyingErrors = emptyList();
}
public AbortExecutionException(Throwable cause) {
super(cause);
this.underlyingErrors = emptyList();
}
@Override
public List getLocations() {
return null;
}
@Override
public ErrorType getErrorType() {
return ErrorType.ExecutionAborted;
}
/**
* @return a list of underlying errors, which may be empty
*/
public List getUnderlyingErrors() {
return underlyingErrors;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy