Skip to content

Commit

Permalink
Change errors to ConnectionErrors in fw.client
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Dec 1, 2024
1 parent d8d8c9d commit 552e5d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/_ert/forward_model_runner/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ async def reconnect(self) -> None:
self.socket.recv_multipart(), timeout=self._connection_timeout
)
if ack.decode() != "ACK":
raise asyncio.TimeoutError("No Ack for connect")
except asyncio.TimeoutError:
raise ClientConnectionError("No Ack for connect")
except asyncio.TimeoutError as exc:
logger.warning("Failed to get acknowledgment on dealer connect!")
raise
raise ClientConnectionError(
"Connection to evaluator not established!"
) from exc

def send(self, messages: str | list[str]) -> None:
self.loop.run_until_complete(self._send(messages))
Expand Down

0 comments on commit 552e5d1

Please sign in to comment.