summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-10-13 18:33:34 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-10-13 18:33:34 +0200
commit31eafadc845af2317c1fcec89620fb145b800572 (patch)
treef7104732f6b4cc40b578473604fafb5dd29718d0 /eaaf_core/src/main/java
parente6f5094b2db9d85a28009c288a6c923e336c82b4 (diff)
downloadEAAF-Components-31eafadc845af2317c1fcec89620fb145b800572.tar.gz
EAAF-Components-31eafadc845af2317c1fcec89620fb145b800572.tar.bz2
EAAF-Components-31eafadc845af2317c1fcec89620fb145b800572.zip
refactor error processing
Diffstat (limited to 'eaaf_core/src/main/java')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java
index dc8caabd..3fc31673 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java
@@ -80,25 +80,31 @@ public class ProtocolFinalizationController extends AbstractController {
// remove exception if it was found
transactionStorage.remove(errorid);
- final ExceptionContainer container =
- (ExceptionContainer) SerializationUtils.deserialize(containerSerialized);
+ final Object containerObj = SerializationUtils.deserialize(containerSerialized);
+ if (containerObj instanceof ExceptionContainer) {
+ final ExceptionContainer container = (ExceptionContainer) containerObj;
+ final Throwable throwable = container.getExceptionThrown();
+ pendingReq = container.getPendingRequest();
- final Throwable throwable = container.getExceptionThrown();
- pendingReq = container.getPendingRequest();
+ if (pendingReq != null) {
+ // build protocol-specific error message if possible
+ protAuthService.buildProtocolSpecificErrorResponse(throwable, req, resp, pendingReq);
- if (pendingReq != null) {
- // build protocol-specific error message if possible
- protAuthService.buildProtocolSpecificErrorResponse(throwable, req, resp, pendingReq);
+ // remove active user-session
+ transactionStorage.remove(pendingReq.getPendingRequestId());
- // remove active user-session
- transactionStorage.remove(pendingReq.getPendingRequestId());
+ } else {
+ protAuthService.handleErrorNoRedirect(throwable, req, resp, true);
- return;
+ }
} else {
- protAuthService.handleErrorNoRedirect(throwable, req, resp, true);
+ protAuthService.handleErrorNoRedirect(
+ new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC, null),
+ req, resp, false);
}
+
} else {
protAuthService.handleErrorNoRedirect(
new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_AUTH_NOPENDIGREQID, null),