fix config file test due to toml-serialization changes
This commit is contained in:
parent
b098d9ea85
commit
a26bfab7e5
|
@ -21,7 +21,7 @@ proc writeValue*(w: var EnvvarWriter, value: auto) =
|
|||
elif value is (SomePrimitives or range):
|
||||
let key = constructKey(w.prefix, w.key)
|
||||
setValue(key, value)
|
||||
|
||||
|
||||
elif value is Option:
|
||||
if value.isSome:
|
||||
w.writeValue value.get
|
||||
|
|
|
@ -149,13 +149,19 @@ proc readValue(r: var TomlReader,
|
|||
value = T r.parseAsString()
|
||||
|
||||
proc readValue(r: var TomlReader, value: var ValidIpAddress) =
|
||||
value = ValidIpAddress.init(r.parseAsString())
|
||||
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) =
|
||||
value = hexToByteArray[value.len](r.parseAsString())
|
||||
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)) =
|
||||
|
|
Loading…
Reference in New Issue