mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 12:15:08 +02:00
Use more specific exception type for imap decoding (#104227)
* Use more specific exception type for imap decoding * Only catch ValueError
This commit is contained in:
@@ -167,7 +167,7 @@ class ImapMessage:
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return str(part.get_payload(decode=True).decode(self._charset))
|
return str(part.get_payload(decode=True).decode(self._charset))
|
||||||
except Exception: # pylint: disable=broad-except
|
except ValueError:
|
||||||
return str(part.get_payload())
|
return str(part.get_payload())
|
||||||
|
|
||||||
part: Message
|
part: Message
|
||||||
|
Reference in New Issue
Block a user