Fix fatal exception when unable to connect to Manager

This commit is contained in:
2019-02-14 12:46:00 +01:00
parent c176da19a6
commit 07263c3a2d

View File

@@ -213,7 +213,7 @@ class FlamencoWorker:
resp = await self.manager.post(url, **post_kwargs)
resp.raise_for_status()
except requests.RequestException as ex:
if not may_retry_loop or ex.response.status_code == 401:
if not may_retry_loop or (ex.response and ex.response.status_code == 401):
self._log.debug('Unable to POST to manager %s: %s', url, ex)
raise