From 136ac3f550d81a8e6d09c587a166a3c3f8173625 Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni Date: Fri, 7 Feb 2020 15:40:56 +0900 Subject: [PATCH] Use already existing error for channel push over size --- libp2p/muxers/mplex/mplex.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index c0e018159..3645fc64f 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -108,8 +108,7 @@ method handle*(m: Mplex) {.async, gcsafe.} = size = data.len if data.len > MaxMsgSize: - raise newException(CatchableError, - "Message size over the limit of 1MiB per message.") + raise newLPStreamLimitError(); await channel.pushTo(data) of MessageType.CloseIn, MessageType.CloseOut: trace "closing channel", id = id,