-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
handle missing exc_info in ExceptionDictTransformer #657
Merged
hynek
merged 5 commits into
hynek:main
from
yaelmi3:issue-656-handle-empty-exc_info-in-ExceptionDictTransformer
Nov 9, 2024
Merged
handle missing exc_info in ExceptionDictTransformer #657
hynek
merged 5 commits into
hynek:main
from
yaelmi3:issue-656-handle-empty-exc_info-in-ExceptionDictTransformer
Nov 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hynek
force-pushed
the
issue-656-handle-empty-exc_info-in-ExceptionDictTransformer
branch
2 times, most recently
from
October 12, 2024 13:28
d271e70
to
e342def
Compare
- Added a new utility function is_missing_exc_info to check if exc_info is missing. - Updated ExceptionDictTransformer to return an empty list when exc_info is missing. - Modified _format_exception to use the new is_missing_exc_info function. - Added a test case to verify that ExceptionDictTransformer returns an empty list when exc_info is missing.
for more information, see https://pre-commit.ci
yaelmi3
force-pushed
the
issue-656-handle-empty-exc_info-in-ExceptionDictTransformer
branch
from
October 13, 2024 20:42
e342def
to
81bd8aa
Compare
hynek
reviewed
Nov 9, 2024
for more information, see https://pre-commit.ci
hynek
approved these changes
Nov 9, 2024
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.
Ah the gift that keeps giving – thanks!
9 tasks
sscherfke
added a commit
to sscherfke/structlog
that referenced
this pull request
Jan 5, 2025
Also remove the entry for the now obsolete hynek#657
hynek
added a commit
that referenced
this pull request
Jan 5, 2025
* Handle Logger.exception() outside "except" block Fixes: #634 * Continue fixing * Try a more radical approach to fix _figure_out_exc_info() 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. * Revert #657 The changes introduced in #657 are no longer needed since _format_exception() is now only called if _figure_out_exc_info() detects an actual exception * Simplify branch condition * Apply suggestions from code review Co-authored-by: Hynek Schlawack <hs@ox.cx> * Add changelog entry Also remove the entry for the now obsolete #657 --------- Co-authored-by: Hynek Schlawack <hs@ox.cx>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#656
Summary
Pull Request Check List
main
branch – use a separate branch!api.py
.docs/api.rst
by hand.versionadded
,versionchanged
, ordeprecated
directives..rst
and.md
files is written using semantic newlines.