Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion asynch/proto/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ServerException,
UnexpectedPacketFromServerError,
UnknownPacketFromServerError,
Error,
)
from asynch.proto import constants
from asynch.proto.block import (
Expand Down Expand Up @@ -580,7 +581,11 @@ async def connect(self):
logger.debug("Connecting. Database: %s. User: %s", self.database, self.user)
for host, port in self.hosts:
logger.debug("Connecting to %s:%s", host, port)
return await self._init_connection(host, port)
try:
return await self._init_connection(host, port)
except Exception as err:
logger.error("Failed to connect to %s:%s, error: %s", host, port, err)
raise Error(f'All hosts unreachable: {self.hosts}')

async def execute(
self,
Expand Down