More specific exception handling

This commit is contained in:
croneter 2017-09-06 19:26:48 +02:00
parent da4be6d7e4
commit 3ada7d1a98

View file

@ -190,9 +190,9 @@ class PMS_Websocket(WebSocket):
try:
message = loads(message)
except Exception as ex:
log.error('%s: Error decoding message from websocket: %s'
% (self.__class__.__name__, ex))
except ValueError:
log.error('%s: Error decoding message from websocket'
% self.__class__.__name__)
log.error(message)
return False
try: