01: package liquibase.exception;
02:
03: import liquibase.DatabaseChangeLog;
04: import liquibase.preconditions.FailedPrecondition;
05: import liquibase.preconditions.Precondition;
06:
07: import java.util.ArrayList;
08: import java.util.List;
09:
10: /**
11: * Thrown when a precondition failed.
12: */
13: public class PreconditionFailedException extends Exception {
14:
15: private static final long serialVersionUID = 1L;
16: private List<FailedPrecondition> failedPreconditions;
17:
18: public PreconditionFailedException(String message,
19: DatabaseChangeLog changeLog, Precondition precondition) {
20: this (new FailedPrecondition(message, changeLog, precondition));
21: }
22:
23: public PreconditionFailedException(
24: FailedPrecondition failedPrecondition) {
25: super ("Preconditions Failed");
26: this .failedPreconditions = new ArrayList<FailedPrecondition>();
27: failedPreconditions.add(failedPrecondition);
28: }
29:
30: public PreconditionFailedException(
31: List<FailedPrecondition> failedPreconditions) {
32: super ("Preconditions Failed");
33: this .failedPreconditions = failedPreconditions;
34: }
35:
36: public List<FailedPrecondition> getFailedPreconditions() {
37: return failedPreconditions;
38: }
39:
40: }
|