mirror of https://github.com/vacp2p/nim-libp2p.git
add base exception class and fix hierarchy
This commit is contained in:
parent
a3c00af945
commit
8e3ef540ea
|
@ -13,8 +13,8 @@
|
||||||
import std/[os, osproc, strutils, tables, strtabs]
|
import std/[os, osproc, strutils, tables, strtabs]
|
||||||
import pkg/[chronos, chronicles]
|
import pkg/[chronos, chronicles]
|
||||||
import ../varint, ../multiaddress, ../multicodec, ../cid, ../peerid
|
import ../varint, ../multiaddress, ../multicodec, ../cid, ../peerid
|
||||||
import ../wire, ../multihash, ../protobuf/minprotobuf
|
import ../wire, ../multihash, ../protobuf/minprotobuf, ../errors
|
||||||
import ../crypto/crypto, ../errors
|
import ../crypto/crypto
|
||||||
|
|
||||||
export
|
export
|
||||||
peerid, multiaddress, multicodec, multihash, cid, crypto, wire, errors
|
peerid, multiaddress, multicodec, multihash, cid, crypto, wire, errors
|
||||||
|
@ -155,11 +155,9 @@ type
|
||||||
ticket: PubsubTicket,
|
ticket: PubsubTicket,
|
||||||
message: PubSubMessage): Future[bool] {.gcsafe.}
|
message: PubSubMessage): Future[bool] {.gcsafe.}
|
||||||
|
|
||||||
# TODO: would be nice to be able to map other errors to
|
DaemonError* = object of LPError
|
||||||
# this types with `Result.toException`, but it doesn't work
|
DaemonRemoteError* = object of DaemonError
|
||||||
# in this module
|
DaemonLocalError* = object of DaemonError
|
||||||
DaemonRemoteError* = object of CatchableError
|
|
||||||
DaemonLocalError* = object of CatchableError
|
|
||||||
|
|
||||||
var daemonsCount {.threadvar.}: int
|
var daemonsCount {.threadvar.}: int
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,9 @@ when defined(libp2p_expensive_metrics):
|
||||||
"mplex channels", labels = ["initiator", "peer"])
|
"mplex channels", labels = ["initiator", "peer"])
|
||||||
|
|
||||||
type
|
type
|
||||||
TooManyChannels* = object of MuxerError
|
MplexError* = object of MuxerError
|
||||||
InvalidChannelIdError* = object of MuxerError
|
TooManyChannels* = object of MplexError
|
||||||
|
InvalidChannelIdError* = object of MplexError
|
||||||
|
|
||||||
Mplex* = ref object of Muxer
|
Mplex* = ref object of Muxer
|
||||||
channels: array[bool, Table[uint64, LPChannel]]
|
channels: array[bool, Table[uint64, LPChannel]]
|
||||||
|
|
|
@ -17,6 +17,8 @@ import ../varint,
|
||||||
../multiaddress,
|
../multiaddress,
|
||||||
../errors
|
../errors
|
||||||
|
|
||||||
|
export errors
|
||||||
|
|
||||||
declareGauge(libp2p_open_streams,
|
declareGauge(libp2p_open_streams,
|
||||||
"open stream instances", labels = ["type", "dir"])
|
"open stream instances", labels = ["type", "dir"])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue