-
-
Notifications
You must be signed in to change notification settings - Fork 948
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
Move exception handling logic to Route #2026
Conversation
I'm positive towards this PR. Is any other member that wants to check it? @encode/maintainers |
@tomchristie it would be great to get your eyes on this since no one has really changed this part of the codebase since you originally wrote it |
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.
Are you strong about this code structure?
Do you mind if we maintain the exceptions.py
and create a _<some_good_name_at_root_level>
? I feel like importing wrap_app_handling_exceptions
from middleware/exceptions
is not very logic. 🤔
@encode/maintainers If someone is against this idea, or has any concerns regarding this, or want more context, anything... Please let us know. Otherwise, I'll get this merged end of next week.
#1692 also resolves it in a way that compliments this PR, and without breaking other things. |
Folks, it would be great to get some more input/review here. |
The last bits here: What's our plan regarding the Also, should we update the documentation: https://www.starlette.io/exceptions/#errors-and-handled-exceptions ? |
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.
Do you mind if we change the structure of the files around (I can change it)?
I'd prefer to not remove the file exceptions.py
, and just create a top level _exception_handler.py
.
Sure go for it |
@adriangb I didn't change the documentation, but I think we should do something there for 1.0. Also, I applied this commit: |
Co-authored-by: Marcelo Trylesinski <[email protected]>
Fixes #493, partially resolves #1692 (comment), resolves #1649 (comment)
By moving handling of exceptions to the
Route
level we can use the sameRequest
/WebSocket
object for the endpoint and exception handlers.See #2020 for some more background