diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-06-06 13:31:28 +0200 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-06-06 13:31:28 +0200 |
commit | 823d4ce2504444caac110d3506f82b4dfce4e05b (patch) | |
tree | ca69397c3004bcd3a0402882d466e896c8f9159c | |
parent | 4e61a42420b6e9e91e5bb7bfa2cff9a79e1f964f (diff) | |
download | EAAF-Components-823d4ce2504444caac110d3506f82b4dfce4e05b.tar.gz EAAF-Components-823d4ce2504444caac110d3506f82b4dfce4e05b.tar.bz2 EAAF-Components-823d4ce2504444caac110d3506f82b4dfce4e05b.zip |
change error messages in case of InvalidProtocolExceptions
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java | 24 |
1 files changed, 12 insertions, 12 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 087d83a2..0aa7ff89 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 @@ -373,16 +373,6 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer } } - private void writeBadRequestErrorResponse(final HttpServletRequest req, final HttpServletResponse resp, final EAAFException e) throws IOException { - final String code = statusMessager.mapInternalErrorToExternalError(((InvalidProtocolRequestException)e).getErrorId()); - final String descr = StringEscapeUtils.escapeHtml4(StringEscapeUtils.escapeEcmaScript(e.getMessage())); - resp.setContentType(EAAFConstants.CONTENTTYPE_HTML_UTF8); - resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Protocol validation FAILED!" + - "(Errorcode=" + code + - " | Description=" + descr + ")"); - - } - private void writeHTMLErrorResponse(@NonNull final HttpServletRequest httpReq, @NonNull final HttpServletResponse httpResp, @NonNull final String msg, @NonNull final String errorCode, @Nullable final Object[] params, @NonNull final Exception error) throws IOException, EAAFException { @@ -464,11 +454,21 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer statisticLogger.logErrorOperation(ex, ex.getErrorRequest()); //write error message - writeBadRequestErrorResponse(req, resp, (EAAFException) e); + //writeBadRequestErrorResponse(req, resp, (EAAFException) e); + writeHTMLErrorResponse(req, resp, + e.getMessage(), + statusMessager.getResponseErrorCode(e), + null, + e); } else if (e instanceof InvalidProtocolRequestException) { //send error response - writeBadRequestErrorResponse(req, resp, (EAAFException) e); + //writeBadRequestErrorResponse(req, resp, (EAAFException) e); + writeHTMLErrorResponse(req, resp, + e.getMessage(), + statusMessager.getResponseErrorCode(e), + null, + e); } else if (e instanceof ConfigurationException) { //send HTML formated error message |