Skip to content

Better error handling #509#528

Open
whysage wants to merge 2 commits into
ets-labs:developfrom
whysage:issue-509-better-error-handling
Open

Better error handling #509#528
whysage wants to merge 2 commits into
ets-labs:developfrom
whysage:issue-509-better-error-handling

Conversation

@whysage

@whysage whysage commented Nov 1, 2021

Copy link
Copy Markdown
Contributor

Add providers log on error.

Add providers log on error.
@whysage whysage changed the title #509 Better error handling #509 Nov 1, 2021
@whysage

whysage commented Nov 1, 2021

Copy link
Copy Markdown
Contributor Author

@rmk135
Please review PR.
I'll not sure about it.


Here - #510 - you write that after reraise exception all exceptions will be just general 'Exception'.
I test my code by adding addition try here
src/dependency_injector/providers.pxd
line 582
try: return call(*args, **kwargs) except Exception as exception: raise exception

and receive type of Exception was TypeError (I used this demo
https://github.com/ets-labs/python-dependency-injector/blob/master/examples/demo/with_di.py
without env var timeout - so error was - TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType')


Also, I'm not sure about printing providers, Maybe we can log them somewhere.
Please advise.

Addition idea about problem was to add ENV var like DEPENDENCY_INJECTION_DEBUG_MODE
and print called providers only it is enabled.

I think this issue is very important - for me, it is real hell to find error in dozens providers by unclear error message.
Please help :-)

@rmk135 rmk135 self-assigned this Nov 1, 2021
Comment thread src/dependency_injector/providers.pyx Outdated
Use logging for providers error.
@whysage

whysage commented Nov 20, 2021

Copy link
Copy Markdown
Contributor Author

Hi
@rmk135 @gen-xu
Any updates?

@whysage

whysage commented Dec 5, 2021

Copy link
Copy Markdown
Contributor Author

Hi!
@rmk135 @gen-xu
ping for updates)

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.

3 participants