We are trying to override the default error page you get when there is a routing failure within the Zuul Edge Server and aren't having any luck. We have routes set up like so:
zuul:
routes:
ui: /**
api: /api/**
The default SendErrorFilter attempts to send the request to /error by default and that works when the ui service is up and running as it will serve up /error. But the problem is when the ui server is down, it tries to route to /error and fails. You then get the big nasty exception on your screen saying there was a forwarding error and no fallback was available.
com.netflix.zuul.exception.ZuulException: Forwarding error
org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:140)
org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:105)
com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112)
com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:197)
com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:161)
com.netflix.zuul.FilterProcessor.route(FilterProcessor.java:120)
com.netflix.zuul.ZuulRunner.route(ZuulRunner.java:84)
com.netflix.zuul.http.ZuulServlet.route(ZuulServlet.java:111)
Root Cause:
com.netflix.hystrix.exception.HystrixRuntimeException: uiRibbonCommand failed and no fallback available.
com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:807)
com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:794)
rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:77)
rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
com.netflix.hystrix.AbstractCommand$DeprecatedOnFallbackHookApplication$1.onError(AbstractCommand.java:1516)
com.netflix.hystrix.AbstractCommand$FallbackHookApplication$1.onError(AbstractCommand.java:1406)
com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:314)
com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:306)
How do you set a default Fallback in Zuul to handle these errors so the user doesn't see the nasty exception? I have seen this open issue on spring-cloud-netflix (#250), but I would deal with a default fallback for all routes, not just specific routes. What is the correct way to do this?