-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
✨ Allow custom middlewares to raise HTTPException
s and propagate them
#2036
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2036 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 533 534 +1
Lines 13755 13808 +53
=========================================
+ Hits 13755 13808 +53
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
📝 Docs preview for commit 6e01c59e9ad6225d20fea2db76aa3efc9ef79246 at: https://5f5b4da78fae0e00b631355d--fastapi.netlify.app |
… middleware to surface up through the use of HTTPException, tests to complement it as added additional exception branching
63bd729
to
2ef2a55
Compare
Squashed my commits into one |
📝 Docs preview for commit 2ef2a55 at: https://5f5c74d3c3abcba7c1cbb5bf--fastapi.netlify.app |
@tiangolo this was the main PR I was requesting, the other one I just thought I had found an issue to fix while working on this. Any thoughts on this one? |
@tiangolo any updates on getting this merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been pending for 6 months... any update?
Any updates? |
@tiangolo is there anything I can do to help this PR over the line? |
📝 Docs preview for commit 232f90e at: https://630747cbd722dc6e6762a965--fastapi.netlify.app |
HTTPException
s and propagate them
📝 Docs preview for commit 0111167 at: https://63074a20d722dc702a62a77a--fastapi.netlify.app |
📝 Docs preview for commit 4a4a545 at: https://6307ecdb0d940a1b62e3859d--fastapi.netlify.app |
Great, thanks @ghandic! 🚀 |
When trying to build a custom middleware that checks content size any exceptions raised by the middleware don't get propagated back up. By allowing any HTTPExceptions to be raised as they are we can raise custom exception information into the response