@Override public HttpResponseMessage apply(HttpRequestMessage request) { final SessionContext zuulCtx = request.getContext(); zuulCtx.setErrorResponseSent(true); final String errMesg = "Missing Endpoint filter, name = " + name; zuulCtx.setError(new ZuulException(errMesg, true)); LOG.error(errMesg); return new HttpResponseMessageImpl(zuulCtx, request, 500); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { LOG.error("zuul filter chain handler caught exception. cause=" + String.valueOf(cause), cause); if (zuulRequest != null && !isClientChannelClosed(cause)) { final SessionContext zuulCtx = zuulRequest.getContext(); zuulCtx.setError(cause); zuulCtx.setShouldSendErrorResponse(true); sendResponse(FAILURE_LOCAL, 500, ctx); } else { fireEndpointFinish(true); ctx.close(); } }
@Override public void recordFinalError(HttpRequestMessage requestMsg, Throwable throwable) { if (throwable == null) { return; } final SessionContext zuulCtx = requestMsg.getContext(); // Choose StatusCategory based on the ErrorType. final ErrorType et = requestAttemptFactory.mapNettyToOutboundErrorType(throwable); final StatusCategory nfs = et.getStatusCategory(); zuulCtx.set(CommonContextKeys.STATUS_CATGEORY, nfs); zuulCtx.set(CommonContextKeys.ORIGIN_STATUS_CATEGORY, nfs); zuulCtx.setError(throwable); }
@Override public HttpResponseMessage apply(HttpRequestMessage request) { final SessionContext zuulCtx = request.getContext(); zuulCtx.setErrorResponseSent(true); final String errMesg = "Missing Endpoint filter, name = " + name; zuulCtx.setError(new ZuulException(errMesg, true)); LOG.error(errMesg); return new HttpResponseMessageImpl(zuulCtx, request, 500); }
ZuulStatusCategory.FAILURE_CLIENT_BAD_REQUEST); zuulRequest.getContext().setError(ze); zuulRequest.getContext().setShouldSendErrorResponse(true);
@Override public HttpResponseMessage apply(HttpRequestMessage request) { final SessionContext zuulCtx = request.getContext(); zuulCtx.setErrorResponseSent(true); final String errMesg = "Missing Endpoint filter, name = " + name; zuulCtx.setError(new ZuulException(errMesg, true)); LOG.error(errMesg); return new HttpResponseMessageImpl(zuulCtx, request, 500); }
protected O handleFilterException(final I inMesg, final ZuulFilter<I, O> filter, final Throwable ex) { inMesg.getContext().setError(ex); if (filter.filterType() == ENDPOINT) { inMesg.getContext().setShouldSendErrorResponse(true); } recordFilterError(inMesg, filter, ex); return filter.getDefaultOutput(inMesg); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { LOG.error("zuul filter chain handler caught exception. cause=" + String.valueOf(cause), cause); if (zuulRequest != null && !isClientChannelClosed(cause)) { final SessionContext zuulCtx = zuulRequest.getContext(); zuulCtx.setError(cause); zuulCtx.setShouldSendErrorResponse(true); sendResponse(FAILURE_LOCAL, 500, ctx); } else { fireEndpointFinish(true); ctx.close(); } }
@Override public void recordFinalError(HttpRequestMessage requestMsg, Throwable throwable) { if (throwable == null) { return; } final SessionContext zuulCtx = requestMsg.getContext(); // Choose StatusCategory based on the ErrorType. final ErrorType et = requestAttemptFactory.mapNettyToOutboundErrorType(throwable); final StatusCategory nfs = et.getStatusCategory(); zuulCtx.set(CommonContextKeys.STATUS_CATGEORY, nfs); zuulCtx.set(CommonContextKeys.ORIGIN_STATUS_CATEGORY, nfs); zuulCtx.setError(throwable); }
zuulCtx.setError(ex); zuulCtx.setShouldSendErrorResponse(true);
ZuulStatusCategory.FAILURE_CLIENT_BAD_REQUEST); zuulRequest.getContext().setError(ze); zuulRequest.getContext().setShouldSendErrorResponse(true);
protected O handleFilterException(final I inMesg, final ZuulFilter<I, O> filter, final Throwable ex) { inMesg.getContext().setError(ex); if (filter.filterType() == ENDPOINT) { inMesg.getContext().setShouldSendErrorResponse(true); } recordFilterError(inMesg, filter, ex); return filter.getDefaultOutput(inMesg); }
origin.getProxyTiming(zuulRequest).end(); zuulCtx.set(CommonContextKeys.STATUS_CATGEORY, statusCategory); zuulCtx.setError(ex); zuulCtx.put("origin_http_status", Integer.toString(respStatus));
zuulCtx.setError(ex); zuulCtx.setShouldSendErrorResponse(true);
origin.getProxyTiming(zuulRequest).end(); zuulCtx.set(CommonContextKeys.STATUS_CATGEORY, statusCategory); zuulCtx.setError(ex); zuulCtx.put("origin_http_status", Integer.toString(respStatus));
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { LOG.error("zuul filter chain handler caught exception. cause=" + String.valueOf(cause), cause); if (zuulRequest != null && !isClientChannelClosed(cause)) { final SessionContext zuulCtx = zuulRequest.getContext(); zuulCtx.setError(cause); zuulCtx.setShouldSendErrorResponse(true); sendResponse(FAILURE_LOCAL, 500, ctx); } else { fireEndpointFinish(true); ctx.close(); } }
@Override public void recordFinalError(HttpRequestMessage requestMsg, Throwable throwable) { if (throwable == null) { return; } final SessionContext zuulCtx = requestMsg.getContext(); // Choose StatusCategory based on the ErrorType. final ErrorType et = requestAttemptFactory.mapNettyToOutboundErrorType(throwable); final StatusCategory nfs = et.getStatusCategory(); zuulCtx.set(CommonContextKeys.STATUS_CATGEORY, nfs); zuulCtx.set(CommonContextKeys.ORIGIN_STATUS_CATEGORY, nfs); zuulCtx.setError(throwable); }
protected O handleFilterException(final I inMesg, final ZuulFilter<I, O> filter, final Throwable ex) { inMesg.getContext().setError(ex); if (filter.filterType() == ENDPOINT) { inMesg.getContext().setShouldSendErrorResponse(true); } recordFilterError(inMesg, filter, ex); return filter.getDefaultOutput(inMesg); }
zuulCtx.setError(ex); zuulCtx.setShouldSendErrorResponse(true);
origin.getProxyTiming(zuulRequest).end(); zuulCtx.set(CommonContextKeys.STATUS_CATGEORY, statusCategory); zuulCtx.setError(ex); zuulCtx.put("origin_http_status", Integer.toString(respStatus));