From 7603b8de5ecbb8c99926cb2439ed8bc26540ef97 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 4 Mar 2024 00:27:35 +0100 Subject: [PATCH] catch `WebSocketError` in `wstransport` (#1049) --- libp2p/transports/wstransport.nim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libp2p/transports/wstransport.nim b/libp2p/transports/wstransport.nim index 5b0319fe0..e83492829 100644 --- a/libp2p/transports/wstransport.nim +++ b/libp2p/transports/wstransport.nim @@ -63,13 +63,17 @@ template mapExceptions(body: untyped) = try: body except AsyncStreamIncompleteError: - raise newLPStreamEOFError() + raise newLPStreamIncompleteError() + except AsyncStreamLimitError: + raise newLPStreamLimitError() except AsyncStreamUseClosedError: raise newLPStreamEOFError() except WSClosedError: raise newLPStreamEOFError() - except AsyncStreamLimitError: - raise newLPStreamLimitError() + except WebSocketError: + raise newLPStreamEOFError() + except CatchableError: + raise newLPStreamEOFError() method readOnce*( s: WsStream,