improve some error messages
This commit is contained in:
parent
f1d57487be
commit
f036713d71
@ -105,7 +105,7 @@ class _Context:
|
||||
try:
|
||||
self.config = search.Config.load()
|
||||
except Exception as e:
|
||||
raise SystemExit(f"config error: {e}")
|
||||
raise SystemExit(f"config error: {e!r}")
|
||||
try:
|
||||
self.arguments = arguments_p.from_args(args)
|
||||
except decode.InvalidStep as e:
|
||||
|
@ -29,7 +29,7 @@ class Realm:
|
||||
|
||||
@staticmethod
|
||||
def load(name: str, data: typing.Any) -> Realm:
|
||||
assert isinstance(data, dict)
|
||||
assert isinstance(data, dict), f"Realm section isn't a dictionary: {data!r}"
|
||||
domain = data.pop("domain")
|
||||
servers = data.pop("servers").split()
|
||||
forest_root_domain = data.pop("forest_root_domain", domain)
|
||||
@ -199,7 +199,7 @@ class Config:
|
||||
with open(conf_path) as f:
|
||||
data = yaml.safe_load(f)
|
||||
assert isinstance(data, dict)
|
||||
assert "realms" in data
|
||||
assert "realms" in data, "Missing realms section in config"
|
||||
realms_data = data.pop("realms")
|
||||
assert isinstance(realms_data, dict)
|
||||
realms = {}
|
||||
|
Loading…
Reference in New Issue
Block a user