Catch websocket expection
This commit is contained in:
@@ -90,6 +90,9 @@ def run():
|
|||||||
logger.error(u"PlexPy WebSocket :: %s." % e)
|
logger.error(u"PlexPy WebSocket :: %s." % e)
|
||||||
reconnects += 1
|
reconnects += 1
|
||||||
time.sleep(plexpy.CONFIG.WEBSOCKET_CONNECTION_TIMEOUT)
|
time.sleep(plexpy.CONFIG.WEBSOCKET_CONNECTION_TIMEOUT)
|
||||||
|
except (websocket.WebSocketException, Exception) as e:
|
||||||
|
logger.error(u"PlexPy WebSocket :: %s." % e)
|
||||||
|
break
|
||||||
|
|
||||||
while plexpy.WS_CONNECTED:
|
while plexpy.WS_CONNECTED:
|
||||||
try:
|
try:
|
||||||
@@ -116,6 +119,9 @@ def run():
|
|||||||
ws.shutdown()
|
ws.shutdown()
|
||||||
plexpy.WS_CONNECTED = False
|
plexpy.WS_CONNECTED = False
|
||||||
break
|
break
|
||||||
|
except (websocket.WebSocketException, Exception) as e:
|
||||||
|
logger.error(u"PlexPy WebSocket :: %s." % e)
|
||||||
|
break
|
||||||
|
|
||||||
# Check if we recieved a restart notification and close websocket connection cleanly
|
# Check if we recieved a restart notification and close websocket connection cleanly
|
||||||
if ws_reconnect:
|
if ws_reconnect:
|
||||||
|
Reference in New Issue
Block a user