Skip to content
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

Log traceback if exceptions are ignored #613

Merged
merged 4 commits into from
Nov 7, 2022
Merged

Conversation

tmarice
Copy link
Contributor

@tmarice tmarice commented Jun 24, 2022

Fixes #611

@@ -32,7 +32,7 @@ def _decorator(self, *args, **kwargs):
except ConnectionInterrupted as e:
if self._ignore_exceptions:
if self._log_ignored_exceptions:
self.logger.error(str(e))
self.logger.exception(str(e))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a nice message? when you use exception you do not need to provide the exception but just a message, thew exception is printed afterwards

@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #613 (8a54fa5) into master (44aff88) will increase coverage by 25.6%.
The diff coverage is 0.0%.

❗ Current head 8a54fa5 differs from pull request most recent head 52fc78d. Consider uploading reports for the commit 52fc78d to get more accurate results

@@            Coverage Diff            @@
##           master    #613      +/-   ##
=========================================
+ Coverage    57.8%   83.3%   +25.6%     
=========================================
  Files          39      21      -18     
  Lines        2497    1043    -1454     
  Branches       71       0      -71     
=========================================
- Hits         1441     868     -573     
+ Misses       1041     175     -866     
+ Partials       15       0      -15     
Flag Coverage Δ
mypy ?
tests 83.3% <0.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
django_redis/cache.py 99.2% <0.0%> (+2.3%) ⬆️
django_redis/compressors/lzma.py 0.0% <0.0%> (-93.3%) ⬇️
django_redis/exceptions.py 66.7% <0.0%> (-33.3%) ⬇️
django_redis/compressors/base.py 71.5% <0.0%> (-28.5%) ⬇️
django_redis/hash_ring.py 72.1% <0.0%> (-27.9%) ⬇️
django_redis/serializers/base.py 75.0% <0.0%> (-25.0%) ⬇️
django_redis/__init__.py 30.0% <0.0%> (-10.0%) ⬇️
django_redis/client/default.py 88.8% <0.0%> (-1.5%) ⬇️
django_redis/serializers/pickle.py 100.0% <0.0%> (ø)
tests/test_session.py
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44aff88...52fc78d. Read the comment docs.

@tmarice
Copy link
Contributor Author

tmarice commented Jul 3, 2022

@WisdomPill codecov is complaining that the patch isn't covered with tests, so I'll add some that verify that the full traceback was logged.

I'm not sure the mypy failure is related to this PR, though.

@tmarice
Copy link
Contributor Author

tmarice commented Jul 20, 2022

@WisdomPill Do you mind taking another look at the PR?

@WisdomPill WisdomPill merged commit 040d85e into jazzband:master Nov 7, 2022
@WisdomPill
Copy link
Member

sorry for being late, and very much thank you for the contribution

@foarsitter foarsitter mentioned this pull request Jun 16, 2023
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.

Add exception info to logger message when exceptions are ignored
2 participants