summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2019-04-23 15:00:13 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2019-04-23 15:00:13 +0200
commit5c1b5b863fe8d6c08cfe0749fed7ce9594827f8a (patch)
treee96cf3ae1f3ed011b0588fd7a341038484c55017 /eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
parentf689c1e404b5cf22d17346da75a296c825a3ba03 (diff)
downloadEAAF-Components-5c1b5b863fe8d6c08cfe0749fed7ce9594827f8a.tar.gz
EAAF-Components-5c1b5b863fe8d6c08cfe0749fed7ce9594827f8a.tar.bz2
EAAF-Components-5c1b5b863fe8d6c08cfe0749fed7ce9594827f8a.zip
add different strategies for pendingRequestId generation
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
index 4e58868b..1da8036c 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java
@@ -27,6 +27,7 @@
package at.gv.egiz.eaaf.core.impl.idp.controller;
import java.io.IOException;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -47,6 +48,7 @@ import at.gv.egiz.eaaf.core.api.idp.auth.services.IProtocolAuthenticationService
import at.gv.egiz.eaaf.core.api.logging.IRevisionLogger;
import at.gv.egiz.eaaf.core.api.storage.ITransactionStorage;
import at.gv.egiz.eaaf.core.exceptions.EAAFException;
+import at.gv.egiz.eaaf.core.exceptions.PendingReqIdValidationException;
import at.gv.egiz.eaaf.core.exceptions.ProcessExecutionException;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
import at.gv.egiz.eaaf.core.impl.utils.Random;
@@ -105,7 +107,7 @@ public abstract class AbstractController {
}
protected void handleError(final String errorMessage, final Throwable exceptionThrown,
- final HttpServletRequest req, final HttpServletResponse resp, final IRequest pendingReq) throws IOException, EAAFException {
+ final HttpServletRequest req, final HttpServletResponse resp, IRequest pendingReq) throws IOException, EAAFException {
Throwable loggedException = null;
final Throwable extractedException = extractOriginalExceptionFromProcessException(exceptionThrown);
@@ -115,13 +117,17 @@ public abstract class AbstractController {
//set original exception
loggedException = ((TaskExecutionException) extractedException).getOriginalException();
- //use TaskExecutionException directly, if no Original Exeception is included
- if (loggedException == null)
- loggedException = exceptionThrown;
-
- } else
+ } else if (exceptionThrown instanceof PendingReqIdValidationException) {
+ log.trace("Find pendingRequestId validation exception. Looking for invalid pending-request ... ");
+ if (((PendingReqIdValidationException) exceptionThrown).getInvalidPendingReq() != null)
+ pendingReq = ((PendingReqIdValidationException) exceptionThrown).getInvalidPendingReq();
+
+ }
+
+ //use TaskExecutionException directly, if no Original Exeception is included
+ if (loggedException == null)
loggedException = exceptionThrown;
-
+
try {
//switch to protocol-finalize method to generate a protocol-specific error message