reraise defect in generic exception handler
This commit is contained in:
parent
021e7d6528
commit
e1d18b431b
|
@ -57,10 +57,11 @@ proc toENode*(a: MultiAddress): Result[ENode, cstring] {.raises: [Defect].} =
|
||||||
except CatchableError:
|
except CatchableError:
|
||||||
# This will reach the error exit path below
|
# This will reach the error exit path below
|
||||||
discard
|
discard
|
||||||
except Exception:
|
except Exception as e:
|
||||||
# TODO:
|
# TODO:
|
||||||
# libp2p/crypto/ecnist.nim(118, 20) Error: can raise an unlisted exception: Exception
|
# nim-libp2p/libp2p/multiaddress.nim(616, 40) Error: can raise an unlisted exception: Exception
|
||||||
discard
|
if e of Defect:
|
||||||
|
raise (ref Defect)(e)
|
||||||
|
|
||||||
return err "Invalid MultiAddress"
|
return err "Invalid MultiAddress"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue