diff options
Diffstat (limited to 'eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/exceptions/SL20VdaResponseException.java')
-rw-r--r-- | eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/exceptions/SL20VdaResponseException.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/exceptions/SL20VdaResponseException.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/exceptions/SL20VdaResponseException.java index 1ee490cf..9d2ecc0a 100644 --- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/exceptions/SL20VdaResponseException.java +++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/exceptions/SL20VdaResponseException.java @@ -2,17 +2,55 @@ package at.gv.egiz.eaaf.modules.auth.sl20.exceptions; import javax.annotation.Nullable; +import lombok.Getter; +import lombok.Setter; + public class SL20VdaResponseException extends SL20Exception { private static final long serialVersionUID = 6834803380740916320L; private String vdaSessionId = null; + + + /** + * ErrorCode that was provided by VDA. + */ + @Getter + @Setter + private String sl20ErrorCode = null; + /** + * In case of an error from VDA. + * + * @param messageId internal errorId + * @param parameters error parameters + */ public SL20VdaResponseException(String messageId, Object[] parameters) { super(messageId, parameters); } + /** + * In case of an error from VDA. + * + * @param messageId internal errorId + * @param parameters error parameters + * @param sl20ErrorCode ErrorCode that was provided by VDA + */ + public SL20VdaResponseException(String messageId, Object[] parameters, String sl20ErrorCode) { + super(messageId, parameters); + + this.sl20ErrorCode = sl20ErrorCode; + + } + + /** + * In case of an error from VDA. + * + * @param messageId internal errorId + * @param parameters error parameters + * @param wrapped Exception that was original thrown + */ public SL20VdaResponseException(String messageId, Object[] parameters, Throwable wrapped) { super(messageId, parameters, wrapped); @@ -38,4 +76,19 @@ public class SL20VdaResponseException extends SL20Exception { this.vdaSessionId = vdaSessionId; } + /** + * Create a clone of this exception, but set a new messageId. + * + * @param messageId internal error-code as messageId + * @return Exception with new error-code + */ + public SL20VdaResponseException cloneWith(String messageId) { + SL20VdaResponseException error = new SL20VdaResponseException(messageId, this.getParams(), + this.getCause()); + error.setSl20ErrorCode(this.sl20ErrorCode); + error.setVdaSessionId(this.vdaSessionId); + return error; + + } + } |