Close Plex companion connection on exceptions

- Fixes #137
This commit is contained in:
tomkat83 2016-11-05 16:28:59 +01:00
parent 718adc31e0
commit 1a18c810d0

View file

@ -62,6 +62,14 @@ class RequestMgr:
if conn:
conn.close()
return False
except Exception as e:
log.error("Exception encountered: %s" % e)
# Close connection just in case
try:
conn.close()
except:
pass
return False
def getwithparams(self, host, port, path, params, header={},
protocol="http"):