diff options
| author | lalber <lukas.alber@iaik.tugraz.at> | 2021-04-01 12:38:38 +0200 | 
|---|---|---|
| committer | lalber <lukas.alber@iaik.tugraz.at> | 2021-04-01 12:38:38 +0200 | 
| commit | 5dc061db54f17780d3dc8c41d842a496f523af31 (patch) | |
| tree | 5ad8941ed9a8326e9e4cc50c309725cd9a232e80 /eaaf_core/src/main/java | |
| parent | 997119b8c25bb256c1bf937d427febf975d570ce (diff) | |
| download | EAAF-Components-5dc061db54f17780d3dc8c41d842a496f523af31.tar.gz EAAF-Components-5dc061db54f17780d3dc8c41d842a496f523af31.tar.bz2 EAAF-Components-5dc061db54f17780d3dc8c41d842a496f523af31.zip | |
new handleErroNoRedirect
Diffstat (limited to 'eaaf_core/src/main/java')
| -rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java | 50 | 
1 files changed, 16 insertions, 34 deletions
| diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java index c666eaa9..4ac8bba2 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java @@ -310,45 +310,27 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer    @Override    public void handleErrorNoRedirect(final Throwable throwable, final HttpServletRequest req, -      final HttpServletResponse resp, final boolean writeExceptionToStatisticLog) { -    handleErrorNoRedirect(throwable, req, resp, writeExceptionToStatisticLog, false); -  } +      final HttpServletResponse resp, final boolean writeExceptionToStatisticLog) throws EaafException, IOException { -  private void handleErrorNoRedirect(final Throwable throwable, final HttpServletRequest req, -      final HttpServletResponse resp, final boolean writeExceptionToStatisticLog, final boolean recall) {      ErrorTicketService.HandleData errorData = null; -    try { -      errorData = errorTicketService.createHandleData(throwable, req); +    errorData = errorTicketService.createHandleData(throwable, req); -      // log Exception into statistic database -      if (writeExceptionToStatisticLog) { -        statisticLogger.logErrorOperation(throwable); -      } +    // log Exception into statistic database +    if (writeExceptionToStatisticLog) { +      statisticLogger.logErrorOperation(throwable); +    } -      // write errror to console -      logExceptionToTechnicalLog(errorData); +    // write errror to console +    logExceptionToTechnicalLog(errorData); -      if (errorData.getActionType().equals(ErrorTicketService.ActionType.NOTICKET_NOREDIRECT) || errorData -          .getActionType().equals(ErrorTicketService.ActionType.TICKET_NOREDIRECT) || recall) { -        // return error to Web browser -        displayException(req, resp, errorData); -      } else { -        // TODO introduce separate error type? -        throw new EaafException("internal.configuration.01", new Object[]{ -            errorData.getErrorCode() + " in on_error_action" + ".properties", "Erroraction mapping mismatch"}); -      } - -    } catch (EaafException e) { -      // retry -      if (recall) { -        handleErrorNoRedirect(e, req, resp, writeExceptionToStatisticLog, true); -      } -    } catch (IOException e) { -      // retry -      if (recall) { -        handleErrorNoRedirect(new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC, null, e), req, resp, -            writeExceptionToStatisticLog, true); -      } +    if (errorData.getActionType().equals(ErrorTicketService.ActionType.NOTICKET_NOREDIRECT) || errorData.getActionType() +        .equals(ErrorTicketService.ActionType.TICKET_NOREDIRECT)) { +      // return error to Web browser +      displayException(req, resp, errorData); +    } else { +      // TODO introduce separate error type? +      throw new EaafException("internal.configuration.01", new Object[]{ +          errorData.getErrorCode() + " in on_error_action" + ".properties", "Erroraction mapping mismatch"});      }    } | 
