| 1 | |
package liquibase.exception; |
| 2 | |
|
| 3 | |
import liquibase.changelog.DatabaseChangeLog; |
| 4 | |
import liquibase.precondition.Precondition; |
| 5 | |
import liquibase.precondition.core.ErrorPrecondition; |
| 6 | |
|
| 7 | |
import java.util.ArrayList; |
| 8 | |
import java.util.List; |
| 9 | |
|
| 10 | |
public class PreconditionErrorException extends Exception { |
| 11 | |
|
| 12 | |
private static final long serialVersionUID = 1L; |
| 13 | |
private List<ErrorPrecondition> erroredPreconditions; |
| 14 | |
|
| 15 | |
public PreconditionErrorException(String message, List<ErrorPrecondition> erroredPreconditions) { |
| 16 | 0 | super(message); |
| 17 | 0 | this.erroredPreconditions = erroredPreconditions; |
| 18 | 0 | } |
| 19 | |
|
| 20 | |
public PreconditionErrorException(Exception cause, DatabaseChangeLog changeLog, Precondition precondition) { |
| 21 | 0 | this(new ErrorPrecondition(cause, changeLog, precondition)); |
| 22 | 0 | } |
| 23 | |
|
| 24 | |
public PreconditionErrorException(ErrorPrecondition errorPrecondition) { |
| 25 | 0 | super("Precondition Error"); |
| 26 | 0 | this.erroredPreconditions = new ArrayList<ErrorPrecondition>(); |
| 27 | 0 | erroredPreconditions.add(errorPrecondition); |
| 28 | 0 | } |
| 29 | |
|
| 30 | |
public PreconditionErrorException(List<ErrorPrecondition> errorPreconditions) { |
| 31 | 0 | super("Precondition Error"); |
| 32 | 0 | this.erroredPreconditions = errorPreconditions; |
| 33 | 0 | } |
| 34 | |
|
| 35 | |
public List<ErrorPrecondition> getErrorPreconditions() { |
| 36 | 0 | return erroredPreconditions; |
| 37 | |
} |
| 38 | |
} |