From 42cd78e95b9233d7b2d15352f148434ff8cb8268 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 4 Mar 2024 00:03:44 +0100 Subject: [PATCH] remove unused `LPStreamError` types (#1048) --- libp2p/stream/lpstream.nim | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/libp2p/stream/lpstream.nim b/libp2p/stream/lpstream.nim index 49446d589..67b89e7f8 100644 --- a/libp2p/stream/lpstream.nim +++ b/libp2p/stream/lpstream.nim @@ -50,12 +50,7 @@ type LPStreamError* = object of LPError LPStreamIncompleteError* = object of LPStreamError - LPStreamIncorrectDefect* = object of Defect LPStreamLimitError* = object of LPStreamError - LPStreamReadError* = object of LPStreamError - par*: ref CatchableError - LPStreamWriteError* = object of LPStreamError - par*: ref CatchableError LPStreamEOFError* = object of LPStreamError # X | Read | Write @@ -77,30 +72,12 @@ type opened*: uint64 closed*: uint64 -proc newLPStreamReadError*(p: ref CatchableError): ref LPStreamReadError = - var w = newException(LPStreamReadError, "Read stream failed") - w.msg = w.msg & ", originated from [" & $p.name & "] " & p.msg - w.par = p - result = w - -proc newLPStreamReadError*(msg: string): ref LPStreamReadError = - newException(LPStreamReadError, msg) - -proc newLPStreamWriteError*(p: ref CatchableError): ref LPStreamWriteError = - var w = newException(LPStreamWriteError, "Write stream failed") - w.msg = w.msg & ", originated from [" & $p.name & "] " & p.msg - w.par = p - result = w - proc newLPStreamIncompleteError*(): ref LPStreamIncompleteError = result = newException(LPStreamIncompleteError, "Incomplete data received") proc newLPStreamLimitError*(): ref LPStreamLimitError = result = newException(LPStreamLimitError, "Buffer limit reached") -proc newLPStreamIncorrectDefect*(m: string): ref LPStreamIncorrectDefect = - result = newException(LPStreamIncorrectDefect, m) - proc newLPStreamEOFError*(): ref LPStreamEOFError = result = newException(LPStreamEOFError, "Stream EOF!")