Skip to content

Commit

Permalink
Use more specific exception type for imap decoding (#104227)
Browse files Browse the repository at this point in the history
* Use more specific exception type for imap decoding

* Only catch ValueError
  • Loading branch information
jbouwh committed Nov 20, 2023
1 parent 80f8e76 commit 4da77d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion homeassistant/components/imap/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _decode_payload(part: Message) -> str:
"""
try:
return str(part.get_payload(decode=True).decode(self._charset))
except Exception: # pylint: disable=broad-except
except ValueError:
return str(part.get_payload())

part: Message
Expand Down

0 comments on commit 4da77d2

Please sign in to comment.