Skip to content

Commit

Permalink
Merge pull request #244 from akrherz/gh243_emailed_errors
Browse files Browse the repository at this point in the history
Fix by trimming binary content message
  • Loading branch information
akrherz authored Jun 22, 2024
2 parents b1d02a4 + 0e6a476 commit 8ea430e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
types: [python]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.8"
rev: "v0.4.10"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
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 8ea430e

Please sign in to comment.