refactor: Use error code in make_address() calls (#3044)

Function `ip::make_address()` throws an exception on an invalid IP.
Refactor to a better error handling without exceptions.
This commit is contained in:
Sergey Kuznetsov
2026-04-27 11:32:07 +01:00
committed by GitHub
parent d7bcf6e726
commit fe0bf736fb
9 changed files with 191 additions and 55 deletions

View File

@@ -312,7 +312,8 @@ getClioConfig()
{"num_markers",
ConfigValue{ConfigType::Integer}.optional().withConstraint(gValidateNumMarkers)},
{"dos_guard.whitelist.[]", Array{ConfigValue{ConfigType::String}.optional()}},
{"dos_guard.whitelist.[]",
Array{ConfigValue{ConfigType::String}.optional().withConstraint(gValidateIp)}},
{"dos_guard.max_fetches",
ConfigValue{ConfigType::Integer}.defaultValue(1000'000u).withConstraint(gValidateUint32)},
{"dos_guard.max_connections",
@@ -361,7 +362,8 @@ getClioConfig()
{"server.ws_max_sending_queue_size",
ConfigValue{ConfigType::Integer}.defaultValue(1500).withConstraint(gValidateUint32)},
{"server.__ng_web_server", ConfigValue{ConfigType::Boolean}.defaultValue(false)},
{"server.proxy.ips.[]", Array{ConfigValue{ConfigType::String}}},
{"server.proxy.ips.[]",
Array{ConfigValue{ConfigType::String}.withConstraint(gValidateIp)}},
{"server.proxy.tokens.[]", Array{ConfigValue{ConfigType::String}}},
{"prometheus.enabled", ConfigValue{ConfigType::Boolean}.defaultValue(true)},