Skip to content

Commit

Permalink
fix: trim log message of binary content
Browse files Browse the repository at this point in the history
closes #243
  • Loading branch information
akrherz committed Jun 22, 2024
1 parent bca039c commit 0e6a476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ All notable changes to this library are documented in this file.

### Bug Fixes

- Trim log and emailed message when product is binary (#243).

## **1.6.0** (6 May 2024)

### API Changes
Expand Down
2 changes: 2 additions & 0 deletions src/pywwa/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def email_error(exp, message="", trimstr=100):
if isinstance(message, str):
LOG.info(message[:trimstr])
else:
# Message is bytes and likely not all that useful, so repr and trim it
message = repr(message)[:trimstr]
LOG.info(message)

# Logic to prevent email bombs
Expand Down

0 comments on commit 0e6a476

Please sign in to comment.