@SuppressWarnings("static-method") private void doFailure(RequestContext rc, HttpStatus code, String message) { SvcLogicContext svcLogic = rc.getSvcLogicContext(); String msg = (message == null) ? code.getReasonPhrase() : message; if (msg.contains("\n")) { msg = msg.substring(msg.indexOf("\n")); } String status; try { status = Integer.toString(code.getStatusCode()); } catch (Exception e) { status = "500"; } svcLogic.setStatus(OUTCOME_FAILURE); svcLogic.setAttribute("healthcheck.result.code", "200"); svcLogic.setAttribute("healthcheck.result.message", status+" "+msg); } /**
@SuppressWarnings("static-method") private void doFailure(RequestContext rc, HttpStatus code, String message) { SvcLogicContext svcLogic = rc.getSvcLogicContext(); String msg = (message == null) ? code.getReasonPhrase() : message; if (msg.contains("\n")) { msg = msg.substring(msg.indexOf('\n')); } String status; try { status = Integer.toString(code.getStatusCode()); } catch (Exception e) { logger.error("Exception occurred", e); status = "500"; } svcLogic.setStatus(OUTCOME_FAILURE); svcLogic.setAttribute(Constants.ATTRIBUTE_ERROR_CODE, status); svcLogic.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE, msg); svcLogic.setAttribute(Constants.CONTEXT_ERROR_CODE, status); svcLogic.setAttribute(Constants.CONTEXT_ERROR_MESSAGE, msg); }
request, response, response.getErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), e); } catch (IOException ignored) {
request, response, response.getErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), e); } catch (IOException ignored) {
request, response, response.getErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), e); } catch (IOException ignored) {
request, response, response.getErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), e); } catch (IOException ignored) {
request, response, response.getErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), e); } catch (IOException ignored) {
request, response, response.getErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), e); } catch (IOException ignored) {
request, response, response.getErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), e); } catch (IOException ignored) {
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }
/** * {@inheritDoc} */ @Override public String generate(final Request request, final int status, final String reasonPhrase, final String description, final Throwable exception) { if (status == 404) { return HtmlHelper.getErrorPage(HttpStatus.NOT_FOUND_404.getReasonPhrase(), "Resource identified by path '" + HttpUtils.filter(request.getRequestURI()) + "', does not exist.", request.getServerFilter().getFullServerName()); } return HtmlHelper.getExceptionErrorPage(reasonPhrase, description, request.getServerFilter().getFullServerName(), exception); } }