From 736f072ccffd0451f9fce6b28d8b9c36b37a0fd8 Mon Sep 17 00:00:00 2001 From: croneter Date: Wed, 17 Mar 2021 21:31:19 +0100 Subject: [PATCH] Fix error socket.timeout: timed out --- resources/lib/plex_functions.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/lib/plex_functions.py b/resources/lib/plex_functions.py index c48a0aa9..b3c3a44d 100644 --- a/resources/lib/plex_functions.py +++ b/resources/lib/plex_functions.py @@ -265,11 +265,15 @@ def _plex_gdm(): 'data': data.decode('utf-8')}) except socket.timeout: break - except Exception as e: + except Exception as error: + # For some reason, above socket.timeout does not catch :-( + LOG.debug('got an unexpected exception %s: %s', + type(error), error) + break + except Exception as error: # Probably error: (101, 'Network is unreachable') - LOG.error(e) - import traceback - LOG.error("Traceback:\n%s", traceback.format_exc()) + LOG.exception('Got a really unexpected exception %s: %s', + type(error), error) finally: gdm.close() LOG.debug('Plex GDM returned the data: %s', return_data)