mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 06:35:10 +02:00
Catch all errors when doing mqtt message unicode-decode. (#4143)
* catch all errors when doing mqtt message unicode-decode. * added AttributeError and UnicodeDecodeError to exception when decoding an mqtt message payload
This commit is contained in:
@@ -399,7 +399,7 @@ class MQTT(object):
|
||||
"""Message received callback."""
|
||||
try:
|
||||
payload = msg.payload.decode('utf-8')
|
||||
except AttributeError:
|
||||
except (AttributeError, UnicodeDecodeError):
|
||||
_LOGGER.error("Illegal utf-8 unicode payload from "
|
||||
"MQTT topic: %s, Payload: %s", msg.topic,
|
||||
msg.payload)
|
||||
|
Reference in New Issue
Block a user