Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,10 @@ def _process_outgoing_frame(self, channel: int, frame) -> None:
ConnectionState.OPEN_SENT,
ConnectionState.OPENED,
]:
raise ValueError("Connection not open.")
raise AMQPConnectionError(
ErrorCondition.SocketError,
description="Connection not open."
)
now = time.time()
if get_local_timeout(
now,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,11 @@ def _write(self, s):
"""Write a string out to the SSL socket fully.
:param str s: The string to write.
"""
write = self.sock.send
try:
write = self.sock.send
except AttributeError:
raise IOError("Socket has already been closed.") from None

while s:
try:
n = write(s)
Expand All @@ -659,7 +663,7 @@ def _write(self, s):
# None.
n = 0
if not n:
raise IOError("Socket closed")
raise IOError("Socket closed.")
s = s[n:]

def negotiate(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,10 @@ async def _process_outgoing_frame(self, channel: int, frame) -> None:
ConnectionState.OPEN_SENT,
ConnectionState.OPENED,
]:
raise ValueError("Connection not open.")
raise AMQPConnectionError(
ErrorCondition.SocketError,
description="Connection not open."
)
now = time.time()
if get_local_timeout(
now,
Expand Down