Skip to content

Catch our blocking exception when it is nested. Eg. spring framework. #373

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

Merged
merged 3 commits into from
Oct 21, 2022

Conversation

tyroneyu
Copy link
Contributor

@tyroneyu tyroneyu commented Oct 20, 2022

Description

Please include a summary of the change, motivation and context.

When a filter blocks a request (eg. traceable filter), the http code returned is 500. It should be 403. The happens when the exception that we throw is nested and we are not catching it properly. This can be produced when used the spring framework as an app.

Testing

Manual tested with a spring framework app

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

@shashank11p shashank11p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! While we are at it, can we add this loop at other places where we are catching this exception as well?

@tyroneyu
Copy link
Contributor Author

Nice! While we are at it, can we add this loop at other places where we are catching this exception as well?

I only see one spot where we "catch" this exception. The other areas just check and rethrow the exception. In those try blocks, they all call ByeBufferSpanPair.captureBody and that is where the exception is thrown.

@tyroneyu
Copy link
Contributor Author

I'm going to merge this and open a new jira to track the snyk error work. I think it's a bigger/wider ranging effort.

@tyroneyu tyroneyu merged commit 6ef6c30 into main Oct 21, 2022
@tyroneyu tyroneyu deleted the fixBlocking500 branch October 21, 2022 19:56
shashank11p pushed a commit that referenced this pull request Feb 24, 2023
…#373)

* Catch our blocking exception when it is nested.  Eg. spring framework.

* Add test

* Running spotlessapply
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

Successfully merging this pull request may close these issues.

2 participants