Skip to content

Commit 333ada3

Browse files
fix(websocket): do not swallow cancellations (#284)
Websocket client requests do not handle cancellation properly; they wrap a `CancelledError` in an `RpcPostError`. Any code that uses websocket requests can therefore no longer be cancelled properly. This change fixes the issue.
1 parent 5436f7e commit 333ada3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

json_rpc/clients/websocketclient.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ method request(
8484
client.withPendingFut(fut, id):
8585
try:
8686
await transport.send(reqData, Opcode.Binary)
87+
except CancelledError as exc:
88+
raise exc
8789
except CatchableError as exc:
8890
raise (ref RpcPostError)(msg: exc.msg, parent: exc)
8991

0 commit comments

Comments
 (0)