mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-02-28 02:54:11 +00:00
fix: reduce validation error message
This commit is contained in:
@@ -267,15 +267,12 @@ class AfterDetailerScript(scripts.Script):
|
||||
try:
|
||||
inp = ADetailerArgs(**arg_dict)
|
||||
except ValueError as e:
|
||||
msgs = [
|
||||
f"[-] ADetailer: ValidationError when validating {ordinal(n)} arguments: {e}\n"
|
||||
]
|
||||
for attr in ALL_ARGS.attrs:
|
||||
arg = arg_dict.get(attr)
|
||||
dtype = type(arg)
|
||||
arg = "DEFAULT" if arg is None else repr(arg)
|
||||
msgs.append(f" {attr}: {arg} ({dtype})")
|
||||
raise ValueError("\n".join(msgs)) from e
|
||||
msg = f"[-] ADetailer: ValidationError when validating {ordinal(n)} arguments"
|
||||
if hasattr(e, "add_note"):
|
||||
e.add_note(msg)
|
||||
else:
|
||||
print(msg, file=sys.stderr)
|
||||
raise
|
||||
|
||||
all_inputs.append(inp)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user