Use CatchableError
This commit is contained in:
parent
b706b994ec
commit
d5b51bcf9e
|
@ -48,7 +48,7 @@ type
|
|||
Base32Types* = Base32NoPadTypes | Base32PadTypes
|
||||
## Supported types
|
||||
|
||||
Base32Error* = object of Exception
|
||||
Base32Error* = object of CatchableError
|
||||
## Base32 specific exception type
|
||||
|
||||
proc newAlphabet32*(s: string): Base32Alphabet =
|
||||
|
|
|
@ -30,7 +30,7 @@ type
|
|||
Base58C* = BTCBase58 | FLCBase58
|
||||
## Supported types
|
||||
|
||||
Base58Error* = object of Exception
|
||||
Base58Error* = object of CatchableError
|
||||
## Base58 specific exception type
|
||||
|
||||
proc newAlphabet58*(s: string): Base58Alphabet =
|
||||
|
|
|
@ -36,7 +36,7 @@ type
|
|||
Base64Types* = Base64 | Base64Pad | Base64Url | Base64UrlPad
|
||||
## All types
|
||||
|
||||
Base64Error* = object of Exception
|
||||
Base64Error* = object of CatchableError
|
||||
## Base64 specific exception type
|
||||
|
||||
proc newAlphabet64*(s: string): Base64Alphabet =
|
||||
|
|
|
@ -24,7 +24,7 @@ type
|
|||
hpos*: int
|
||||
data*: VBuffer
|
||||
|
||||
CidError* = object of Exception
|
||||
CidError* = object of CatchableError
|
||||
|
||||
const
|
||||
ContentIdsList = [
|
||||
|
|
|
@ -74,8 +74,8 @@ type
|
|||
Signature* = object
|
||||
data*: seq[byte]
|
||||
|
||||
P2pKeyError* = object of Exception
|
||||
P2pSigError* = object of Exception
|
||||
P2pKeyError* = object of CatchableError
|
||||
P2pSigError* = object of CatchableError
|
||||
|
||||
const
|
||||
SupportedSchemes* = {RSA, Ed25519, ECDSA}
|
||||
|
|
|
@ -56,11 +56,11 @@ type
|
|||
|
||||
EcPKI* = EcPrivateKey | EcPublicKey | EcSignature
|
||||
|
||||
EcError* = object of Exception
|
||||
EcError* = object of CatchableError
|
||||
EcKeyIncorrectError* = object of EcError
|
||||
EcRngError* = object of EcError
|
||||
EcPublicKeyError* = object of EcError
|
||||
EcSignatureError = object of EcError
|
||||
EcSignatureError* = object of EcError
|
||||
|
||||
const
|
||||
EcSupportedCurvesCint* = {cint(Secp256r1), cint(Secp384r1), cint(Secp521r1)}
|
||||
|
|
|
@ -38,7 +38,7 @@ type
|
|||
seckey*: EdPrivateKey
|
||||
pubkey*: EdPublicKey
|
||||
|
||||
EdError* = object of Exception
|
||||
EdError* = object of CatchableError
|
||||
EdRngError* = object of EdError
|
||||
EdIncorrectError* = object of EdError
|
||||
|
||||
|
|
|
@ -70,11 +70,11 @@ type
|
|||
RsaPKI* = RsaPrivateKey | RsaPublicKey | RsaSignature
|
||||
RsaKP* = RsaPrivateKey | RsaKeyPair
|
||||
|
||||
RsaError = object of Exception
|
||||
RsaRngError = object of RsaError
|
||||
RsaGenError = object of RsaError
|
||||
RsaKeyIncorrectError = object of RsaError
|
||||
RsaSignatureError = object of RsaError
|
||||
RsaError* = object of CatchableError
|
||||
RsaRngError* = object of RsaError
|
||||
RsaGenError* = object of RsaError
|
||||
RsaKeyIncorrectError* = object of RsaError
|
||||
RsaSignatureError* = object of RsaError
|
||||
|
||||
template getStart(bs, os, ls: untyped): untyped =
|
||||
let p = cast[uint](os)
|
||||
|
|
|
@ -146,8 +146,8 @@ type
|
|||
ticket: PubsubTicket,
|
||||
message: PubSubMessage): Future[bool] {.gcsafe.}
|
||||
|
||||
DaemonRemoteError* = object of Exception
|
||||
DaemonLocalError* = object of Exception
|
||||
DaemonRemoteError* = object of CatchableError
|
||||
DaemonLocalError* = object of CatchableError
|
||||
|
||||
var daemonsCount {.threadvar.}: int
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ type
|
|||
flag*: bool
|
||||
rem*: seq[MultiCodec]
|
||||
|
||||
MultiAddressError* = object of Exception
|
||||
MultiAddressError* = object of CatchableError
|
||||
|
||||
proc ip4StB(s: string, vb: var VBuffer): bool =
|
||||
## IPv4 stringToBuffer() implementation.
|
||||
|
|
|
@ -38,7 +38,7 @@ type
|
|||
encl: MBCodeSize
|
||||
decl: MBCodeSize
|
||||
|
||||
MultiBaseError* = object of Exception
|
||||
MultiBaseError* = object of CatchableError
|
||||
|
||||
proc idd(inbytes: openarray[char], outbytes: var openarray[byte],
|
||||
outlen: var int): MultibaseStatus =
|
||||
|
|
|
@ -230,7 +230,7 @@ const MultiCodecList = [
|
|||
|
||||
type
|
||||
MultiCodec* = distinct int
|
||||
MultiCodecError* = object of Exception
|
||||
MultiCodecError* = object of CatchableError
|
||||
|
||||
const
|
||||
InvalidMultiCodec* = MultiCodec(-1)
|
||||
|
|
|
@ -44,7 +44,7 @@ type
|
|||
size*: int
|
||||
dpos*: int
|
||||
|
||||
MultiHashError* = object of Exception
|
||||
MultiHashError* = object of CatchableError
|
||||
|
||||
proc identhash(data: openarray[byte], output: var openarray[byte]) =
|
||||
if len(output) > 0:
|
||||
|
|
|
@ -20,7 +20,7 @@ type
|
|||
PeerID* = object
|
||||
data*: seq[byte]
|
||||
|
||||
PeerIDError* = object of Exception
|
||||
PeerIDError* = object of CatchableError
|
||||
|
||||
proc pretty*(pid: PeerID): string {.inline.} =
|
||||
## Return base58 encoded ``pid`` representation.
|
||||
|
|
|
@ -35,7 +35,7 @@ type
|
|||
LPSomeVarint* = LPSomeUVarint
|
||||
SomeVarint* = PBSomeVarint | LPSomeVarint
|
||||
SomeUVarint* = PBSomeUVarint | LPSomeUVarint
|
||||
VarintError* = object of Exception
|
||||
VarintError* = object of CatchableError
|
||||
|
||||
proc vsizeof*(x: SomeVarint): int {.inline.} =
|
||||
## Returns number of bytes required to encode integer ``x`` as varint.
|
||||
|
|
Loading…
Reference in New Issue