Use already existing error for channel push over size
This commit is contained in:
parent
f9cbdc252f
commit
136ac3f550
|
@ -108,8 +108,7 @@ method handle*(m: Mplex) {.async, gcsafe.} =
|
||||||
size = data.len
|
size = data.len
|
||||||
|
|
||||||
if data.len > MaxMsgSize:
|
if data.len > MaxMsgSize:
|
||||||
raise newException(CatchableError,
|
raise newLPStreamLimitError();
|
||||||
"Message size over the limit of 1MiB per message.")
|
|
||||||
await channel.pushTo(data)
|
await channel.pushTo(data)
|
||||||
of MessageType.CloseIn, MessageType.CloseOut:
|
of MessageType.CloseIn, MessageType.CloseOut:
|
||||||
trace "closing channel", id = id,
|
trace "closing channel", id = id,
|
||||||
|
|
Loading…
Reference in New Issue