Remove crazy JSON encoding things that are no longer used (#13029)

Catch JSON encoding errors in HTTP view
This commit is contained in:
Paulus Schoutsen 2018-03-12 15:22:08 -07:00 committed by Fabian Affolter
parent ae286a550b
commit 0a2e949e0a
4 changed files with 28 additions and 15 deletions

View file

@ -240,7 +240,11 @@ class ActiveConnection:
if message is None:
break
self.debug("Sending", message)
await self.wsock.send_json(message, dumps=JSON_DUMP)
try:
await self.wsock.send_json(message, dumps=JSON_DUMP)
except TypeError as err:
_LOGGER.error('Unable to serialize to JSON: %s\n%s',
err, message)
@callback
def send_message_outside(self, message):