Catch status code errors
This commit is contained in:
parent
fcceb744c5
commit
05ca673883
@ -437,12 +437,12 @@ class ExternalSignalController(RPCHandler):
|
|||||||
# as we might call the RPC module in the main thread
|
# as we might call the RPC module in the main thread
|
||||||
await self._handle_leader_message(data)
|
await self._handle_leader_message(data)
|
||||||
|
|
||||||
except socket.gaierror:
|
except (socket.gaierror, ConnectionRefusedError):
|
||||||
logger.info(f"Socket error - retrying connection in {self.sleep_time}s")
|
logger.info(f"Connection Refused - retrying connection in {self.sleep_time}s")
|
||||||
await asyncio.sleep(self.sleep_time)
|
await asyncio.sleep(self.sleep_time)
|
||||||
continue
|
continue
|
||||||
except ConnectionRefusedError:
|
except websockets.exceptions.InvalidStatusCode as e:
|
||||||
logger.info(f"Connection Refused - retrying connection in {self.sleep_time}s")
|
logger.error(f"Connection Refused - {e}")
|
||||||
await asyncio.sleep(self.sleep_time)
|
await asyncio.sleep(self.sleep_time)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user