fix config file test due to toml-serialization changes

This commit is contained in:
jangko 2022-09-23 08:49:00 +07:00
parent b098d9ea85
commit a26bfab7e5
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 9 additions and 3 deletions

View File

@ -149,13 +149,19 @@ proc readValue(r: var TomlReader,
value = T r.parseAsString()
proc readValue(r: var TomlReader, value: var ValidIpAddress) =
try:
value = ValidIpAddress.init(r.parseAsString())
except ValueError as ex:
raise newException(SerializationError, ex.msg)
proc readValue(r: var TomlReader, value: var Port) =
value = r.parseInt(int).Port
proc readValue(r: var TomlReader, value: var GraffitiBytes) =
try:
value = hexToByteArray[value.len](r.parseAsString())
except ValueError as ex:
raise newException(SerializationError, ex.msg)
proc readValue(r: var EnvvarReader,
value: var (InputFile | InputDir | OutFile | OutDir | ValidatorKeyPath)) =