liquibase.exception.PreconditionErrorException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liquibase-core Show documentation
Show all versions of liquibase-core Show documentation
Liquibase is a tool for managing and executing database changes.
The newest version!
package liquibase.exception;
import liquibase.changelog.DatabaseChangeLog;
import liquibase.precondition.ErrorPrecondition;
import liquibase.precondition.Precondition;
import java.util.ArrayList;
import java.util.List;
/**
* Thrown when a problem occurs in the evaluation of a precondition (which, under normal circumstances, should never
* happen).
*/
public class PreconditionErrorException extends Exception {
private static final long serialVersionUID = 1L;
private final List erroredPreconditions;
public PreconditionErrorException(String message, List erroredPreconditions) {
super(message);
this.erroredPreconditions = erroredPreconditions;
}
public PreconditionErrorException(Exception cause, DatabaseChangeLog changeLog, Precondition precondition) {
this(new ErrorPrecondition(cause, changeLog, precondition));
}
public PreconditionErrorException(ErrorPrecondition errorPrecondition) {
super("Precondition Error", errorPrecondition.getCause());
this.erroredPreconditions = new ArrayList<>();
erroredPreconditions.add(errorPrecondition);
}
public PreconditionErrorException(List errorPreconditions) {
super("Precondition Error");
this.erroredPreconditions = errorPreconditions;
}
public List getErrorPreconditions() {
return erroredPreconditions;
}
}