Merge pull request #1411 from croneter/fix-socket

Fix error socket.timeout: timed out
This commit is contained in:
croneter 2021-03-17 21:41:46 +01:00 committed by GitHub
commit 9151c149e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,11 +265,15 @@ def _plex_gdm():
'data': data.decode('utf-8')}) 'data': data.decode('utf-8')})
except socket.timeout: except socket.timeout:
break 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') # Probably error: (101, 'Network is unreachable')
LOG.error(e) LOG.exception('Got a really unexpected exception %s: %s',
import traceback type(error), error)
LOG.error("Traceback:\n%s", traceback.format_exc())
finally: finally:
gdm.close() gdm.close()
LOG.debug('Plex GDM returned the data: %s', return_data) LOG.debug('Plex GDM returned the data: %s', return_data)