CombinedConfig should give more details when failing to parse a JSON value.
This commit is contained in:
@@ -95,7 +95,7 @@ proc getJson*(
|
|||||||
elif cfg.json.hasKey(jsonKey): return cfg.json[jsonKey]
|
elif cfg.json.hasKey(jsonKey): return cfg.json[jsonKey]
|
||||||
else: raise newException(ValueError, "cannot find a configuration value for \"" & key & "\"")
|
else: raise newException(ValueError, "cannot find a configuration value for \"" & key & "\"")
|
||||||
except Exception:
|
except Exception:
|
||||||
raise newException(ValueError, "cannot parse value as JSON:" & getCurrentExceptionMsg())
|
raise newException(ValueError, "cannot parse [" & getVal(cfg, key) & "] as JSON:" & getCurrentExceptionMsg())
|
||||||
|
|
||||||
proc getJson*(
|
proc getJson*(
|
||||||
cfg: CombinedConfig,
|
cfg: CombinedConfig,
|
||||||
|
|||||||
Reference in New Issue
Block a user