summaryrefslogtreecommitdiff
path: root/eaaf_modules
diff options
context:
space:
mode:
authorThomas <>2023-04-26 19:04:57 +0200
committerThomas <>2023-04-26 19:04:57 +0200
commit88f52463fd0d3d8bf467b75798b525ce86886acc (patch)
tree5c0c2eba19651444f757a76d11ecb51953cd4599 /eaaf_modules
parent23a754ddce6a407315b8ebb2494b4f0f21bdccbf (diff)
downloadEAAF-Components-88f52463fd0d3d8bf467b75798b525ce86886acc.tar.gz
EAAF-Components-88f52463fd0d3d8bf467b75798b525ce86886acc.tar.bz2
EAAF-Components-88f52463fd0d3d8bf467b75798b525ce86886acc.zip
feat(core): add extension-point to central errorHandler service to set application specific information into error-GUI model
Diffstat (limited to 'eaaf_modules')
-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);