summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_auth_sl20
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_modules/eaaf_module_auth_sl20')
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/exceptions/SL20VdaResponseException.java53
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java2
2 files changed, 54 insertions, 1 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;
+
+ }
+
}
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
index 79a70ff9..d7af8b8e 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
@@ -106,7 +106,7 @@ public abstract class AbstractReceiveQualEidTask extends AbstractAuthServletTask
SL20Constants.SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERRORMESSAGE, false);
final SL20VdaResponseException ex = new SL20VdaResponseException("sl20.08", new Object[] {
- errorCode, errorMsg });
+ errorCode, errorMsg }, errorCode);
log.info("Receiving errorcode: {} with msg: {} from VDA! Stopping auth-process ... ", errorCode,
errorMsg);