mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00: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:
parent
8e695d1eb0
commit
705814cb08
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user