diff --git a/libp2p/daemon/daemonapi.nim b/libp2p/daemon/daemonapi.nim index f6734bf..de4f835 100644 --- a/libp2p/daemon/daemonapi.nim +++ b/libp2p/daemon/daemonapi.nim @@ -13,8 +13,8 @@ import std/[os, osproc, strutils, tables, strtabs] import pkg/[chronos, chronicles] import ../varint, ../multiaddress, ../multicodec, ../cid, ../peerid -import ../wire, ../multihash, ../protobuf/minprotobuf -import ../crypto/crypto, ../errors +import ../wire, ../multihash, ../protobuf/minprotobuf, ../errors +import ../crypto/crypto export peerid, multiaddress, multicodec, multihash, cid, crypto, wire, errors @@ -155,11 +155,9 @@ type ticket: PubsubTicket, message: PubSubMessage): Future[bool] {.gcsafe.} - # TODO: would be nice to be able to map other errors to - # this types with `Result.toException`, but it doesn't work - # in this module - DaemonRemoteError* = object of CatchableError - DaemonLocalError* = object of CatchableError + DaemonError* = object of LPError + DaemonRemoteError* = object of DaemonError + DaemonLocalError* = object of DaemonError var daemonsCount {.threadvar.}: int diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index d56912d..2d84ca2 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -34,8 +34,9 @@ when defined(libp2p_expensive_metrics): "mplex channels", labels = ["initiator", "peer"]) type - TooManyChannels* = object of MuxerError - InvalidChannelIdError* = object of MuxerError + MplexError* = object of MuxerError + TooManyChannels* = object of MplexError + InvalidChannelIdError* = object of MplexError Mplex* = ref object of Muxer channels: array[bool, Table[uint64, LPChannel]] diff --git a/libp2p/stream/lpstream.nim b/libp2p/stream/lpstream.nim index e562548..4d74070 100644 --- a/libp2p/stream/lpstream.nim +++ b/libp2p/stream/lpstream.nim @@ -17,6 +17,8 @@ import ../varint, ../multiaddress, ../errors +export errors + declareGauge(libp2p_open_streams, "open stream instances", labels = ["type", "dir"])