-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Enhancement: Add class and funcion name to ImproperlyConfiguredException
s
#3548
Comments
I definitely +1 this : I found that when switching from another framework, sometimes you make big refactors, forget some stuff and get hit by that and it's hard to find where you made the mistakes as you just changed too many things, this would definitly make the process smoother. |
That's exactly where I'm coming from |
I should have listed them, but there were other cases where this |
Yeah, absolutely. I think we can generally improve a lot of our error messages with more details to make them more useful, but it's going to be a longer process I think. Incremental PRs are definitely welcome there! :) |
Implemented in #3575. |
Summary
When you forget to add a type annotation in a route handler function, Litestar raises ImproperlyConfiguredException but neither the stack trace, nor the message shows which function or method is in error.
If the annotation were checked in
@get
decorators, the stack trace would let you find the line with the problem. If that's impossible, the exception should at least show function name, and the class in case of methods.I volunteer to add function name in
_validate_handler_function()
.Basic Example
No response
Drawbacks and Impact
No response
Unresolved questions
No response
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: