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,