Ivan FB 385daf16be
chore: vendor bump for 0.23.0 (#2274)
* 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
2023-12-14 07:16:39 +01:00

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