01: package org.bouncycastle.tsp;
02:
03: /**
04: * Exception thrown if a TSP request or response fails to validate.
05: * <p>
06: * If a failure code is assciated with the exception it can be retrieved using
07: * the getFailureCode() method.
08: */
09: public class TSPValidationException extends TSPException {
10: private int failureCode = -1;
11:
12: public TSPValidationException(String message) {
13: super (message);
14: }
15:
16: public TSPValidationException(String message, int failureCode) {
17: super (message);
18: this .failureCode = failureCode;
19: }
20:
21: /**
22: * Return the failure code associated with this exception - if one is set.
23: *
24: * @return the failure code if set, -1 otherwise.
25: */
26: public int getFailureCode() {
27: return failureCode;
28: }
29: }
|