mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-09 22:36:32 +00:00
385daf16be
* on_chain/group_manager: use .async: (raises:[Exception]). * bump nim-dnsdisc * update nim-chronos to the latest state * chat2.nim: catch any possible exception when stopping * chat2bridge.nim: make it to compile after vendor bump * ValidIpAddress (deprecated) -> IpAddress * vendor/nim-libp2p additional bump * libwaku: adapt to vendor bump * testlib/wakunode.nim: adapt to vendor bump (ValidIpAddress -> IpAddress) * waku_node: avoid throwing any exception from stop*(node: WakuNode) * test_confutils_envvar.nim: ValidIpAddress -> IpAddress * test_jsonrpc_store: capture exception * test_rln*: handling exceptions * adaptation to make test_rln_* to work properly * signature enhancement of group_manager methods
27 lines
750 B
Nim
27 lines
750 B
Nim
when (NimMajor, NimMinor) < (1, 4):
|
|
{.push raises: [Defect].}
|
|
else:
|
|
{.push raises: [].}
|
|
|
|
import
|
|
std/strutils,
|
|
stew/shims/net
|
|
import
|
|
../../../envvar_serialization
|
|
|
|
export
|
|
net,
|
|
envvar_serialization
|
|
|
|
proc readValue*(r: var EnvvarReader, value: var IpAddress) {.raises: [SerializationError].} =
|
|
try:
|
|
value = parseIpAddress(r.readValue(string))
|
|
except ValueError, IOError:
|
|
raise newException(SerializationError, "Invalid IP address: " & getCurrentExceptionMsg())
|
|
|
|
proc readValue*(r: var EnvvarReader, value: var Port) {.raises: [SerializationError].} =
|
|
try:
|
|
value = parseUInt(r.readValue(string)).Port
|
|
except ValueError, IOError:
|
|
raise newException(SerializationError, "Invalid Port: " & getCurrentExceptionMsg())
|