Better error handling
See original GitHub issueCurrently if the callable provider fails due to missing arguments or other errors, it may be hard to find out which guy is missing arguments if one provider is being referred many times.
src/dependency_injector/providers.pxd:422: in dependency_injector.providers.__provide_keyword_args
???
src/dependency_injector/providers.pxd:345: in dependency_injector.providers.__get_value
???
src/dependency_injector/providers.pyx:195: in dependency_injector.providers.Provider.__call__
???
src/dependency_injector/providers.pyx:197: in dependency_injector.providers.Provider.__call__
???
src/dependency_injector/providers.pyx:2755: in dependency_injector.providers.Singleton._provide
???
src/dependency_injector/providers.pxd:620: in dependency_injector.providers.__factory_call
???
src/dependency_injector/providers.pxd:606: in dependency_injector.providers.__callable_call
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E TypeError: __init__() missing 1 required positional argument: 'config'
src/dependency_injector/providers.pxd:579: TypeError
it may be hard to find out which __init__
, consider re-raise the exception with the function reference
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Better error handling in JavaScript | by Iain Collins - Medium
Establishing good error handling conventions in a project can make it easier to improve the user experience of your software, squash mysterious 'unknown...
Read more >Better error handling in Golang: Theory and practical tips
For more complex error handling, you can define custom error types by implementing the Error() method, which returns the error string.
Read more >Error Handling Best Practices - Auth0
Error Handling Best Practices · Send error logs to an external service · Use error objects in rules · Use meaningful error code...
Read more >Clean Code and the Art of Exception Handling - Toptal
Exception Handling: It's a Good Thing · Always create your own ApplicationError hierarchy · Never rescue Exception · Never rescue more exceptions than...
Read more >SSW.Rules | Rules to Better Error Handling
The best exception handling libraries are: Application Insights (recommended); Seq; RayGun. Your users should never see the “yellow screen of death” in ASP.NET, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was troubleshooting a missing argument today in a FastAPI application and I agree that the error handling makes it hard to see where the error occurred. The only hint I get is the
token_service
.@whysage , no, you can only run it as a C extension