Fix Alexa websocket not exiting on Handshake Status 403

This commit is contained in:
croneter 2017-09-15 20:01:20 +02:00
parent 0dc27dd98c
commit 14b8df4f9c

View file

@ -111,7 +111,8 @@ class WebSocket(Thread):
except websocket.WebSocketException as e: except websocket.WebSocketException as e:
log.info('%s: WebSocketException: %s' log.info('%s: WebSocketException: %s'
% (self.__class__.__name__, e)) % (self.__class__.__name__, e))
if 'Handshake Status 401' in e.args: if ('Handshake Status 401' in e.args
or 'Handshake Status 403' in e.args):
handshake_counter += 1 handshake_counter += 1
if handshake_counter >= 5: if handshake_counter >= 5:
log.info('%s: Error in handshake detected. ' log.info('%s: Error in handshake detected. '