Skip to content
Merged
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: 5 additions & 2 deletions juju/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ async def close(self, to_reconnect=False):

async def _recv(self, request_id):
if not self.is_open:
raise websockets.exceptions.ConnectionClosed(0, 'websocket closed')
raise websockets.exceptions.ConnectionClosed(
websockets.frames.Close(websockets.frames.CloseCode.NORMAL_CLOSURE,
'websocket closed'))
try:
return await self.messages.get(request_id)
except GeneratorExit:
Expand Down Expand Up @@ -604,7 +606,8 @@ async def rpc(self, msg, encoder=None):
if self.monitor.status == Monitor.DISCONNECTED:
# closed cleanly; shouldn't try to reconnect
raise websockets.exceptions.ConnectionClosed(
0, 'websocket closed')
websockets.frames.Close(websockets.frames.CloseCode.NORMAL_CLOSURE,
'websocket closed'))
try:
await self._ws.send(outgoing)
break
Expand Down