Skip to content

Commit f02dcd8

Browse files
authored
Handle socket.gaierror in Connection.connect() (#15)
1 parent 958d4ee commit f02dcd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stompman/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import socket
23
from collections.abc import AsyncGenerator, Iterator
34
from dataclasses import dataclass, field
45
from typing import Protocol, Self, TypedDict, TypeVar, cast
@@ -96,7 +97,7 @@ async def connect(self) -> bool:
9697
asyncio.open_connection(self.connection_parameters.host, self.connection_parameters.port),
9798
timeout=self.connect_timeout,
9899
)
99-
except (TimeoutError, ConnectionError):
100+
except (TimeoutError, ConnectionError, socket.gaierror):
100101
return False
101102
return True
102103

0 commit comments

Comments
 (0)