diff --git a/CHANGELOG.md b/CHANGELOG.md index 9400f66a..9098940c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/pywwa/common.py b/src/pywwa/common.py index acd7d2c1..da45444f 100644 --- a/src/pywwa/common.py +++ b/src/pywwa/common.py @@ -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