Handle Logger.exception() outside "except" block#680
Conversation
The main problem of the function is that *v* can really be anything (depending on what the users) do and the annotated return type did not properly match it (e.g., if *v* was "0", the return value would be "0"). The function now rigorously checks the user input and either returns the desired result (an exc info tuple) or None. This makes it easier and safer to use this function.
|
the tests are red 😇 also have you seen, that there's been changes to missing tracebacks lately – notably #657? 🤔 not sure if that maybe interacts somehow with your changes since it's thematically adjacent. |
|
Didn't have time yet to fix the tests. Just recreated the MR for now. #657 is superfluous now. The problem it handled should no longer be possible with this PR. |
|
Checks are green now. You should still carefully review the changes. ;-) |
|
Do you need anything else from me for this PR to get merged? :-) |
|
Sorry for the delays, I’ll get to structlog (there‘s quite a bit of open issues around exceptions 😰) right after pushing out attrs. I think it’s ready. |
hynek
left a comment
There was a problem hiding this comment.
This very much needs a changelog entry – and as I asked inline, I wonder how breaking this would be considered given how many complains we got for the last release. 🤔
Co-authored-by: Hynek Schlawack <hs@ox.cx>
|
I'll add a changelog entry when the code is ready. |
hynek
left a comment
There was a problem hiding this comment.
ok changelog pls and let's get this behind us
Also remove the entry for the now obsolete hynek#657
|
Done, feel free to edit. :-) |
Summary
Fixes #634, follow-up of #635
Pull Request Check List
mainbranch – use a separate branch!api.py.docs/api.rstby hand.versionadded,versionchanged, ordeprecateddirectives..rstand.mdfiles is written using semantic newlines.