Use CatchableError

This commit is contained in:
Zahary Karadjov 2019-06-10 23:33:36 +03:00 committed by zah
parent b706b994ec
commit d5b51bcf9e
15 changed files with 22 additions and 22 deletions

View File

@ -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 =

View File

@ -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 =

View File

@ -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 =

View File

@ -24,7 +24,7 @@ type
hpos*: int
data*: VBuffer
CidError* = object of Exception
CidError* = object of CatchableError
const
ContentIdsList = [

View File

@ -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}

View File

@ -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)}

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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.

View File

@ -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 =

View File

@ -230,7 +230,7 @@ const MultiCodecList = [
type
MultiCodec* = distinct int
MultiCodecError* = object of Exception
MultiCodecError* = object of CatchableError
const
InvalidMultiCodec* = MultiCodec(-1)

View File

@ -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:

View File

@ -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.

View File

@ -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.