Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use ZuulException in the filters #101

Closed
KhodyrevDS opened this issue Jan 23, 2015 · 5 comments
Closed

Can't use ZuulException in the filters #101

KhodyrevDS opened this issue Jan 23, 2015 · 5 comments

Comments

@KhodyrevDS
Copy link

You cant use ZuulException in the filter's run method because run not throws ZuulException and ZuulException is not RuntimeException

@apatil4
Copy link

apatil4 commented Feb 18, 2015

+1 on that issue. We can workaround that but with unnecessary logic of putting the exception in Request Context. Also the try - catch block in ZuulServlet serves no purpose if exceptions are happening in the filters and the error filters cannot be executed at all.

Can the run method in IZuulFilter interface throw a ZuulException. In that case any other Exceptions in the filters can be wrapped in the ZuulException.

If the above approach is fine, I can submit a pull request

@sarpk
Copy link

sarpk commented Sep 27, 2016

Any update on this?? I'm also having the same issue

@Aloren
Copy link

Aloren commented Nov 15, 2016

Why pull request was closed? :( I also need this. Currently throwing zuul exception is a headache in java code

@robinvandenberg
Copy link

+1

There is a workaround (https://jmnarloch.wordpress.com/2015/09/16/spring-cloud-zuul-error-handling/) but that feels quite dirty and is creating more overhead than needed. It would be nice to throw a ZuulException with statuscode + errormessage from a filter.

@mattnelson
Copy link

Why pull request was closed? :( I also need this. Currently throwing zuul exception is a headache in java code

I was doing some cleanup on my fork and deleted the branch before it was merged, which auto closed the pull request. I can see about getting a new PR out, though keep in mind the PR was out there for 5+ months and not merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants