From: Zbigniew Jędrzejewski-Szmek Date: Mon, 9 Sep 2024 13:34:29 +0000 (+0200) Subject: sandbox: use ValueError X-Git-Tag: v25~301^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8667af89beda6fd7a6a815355982bcc36c10bd91;p=thirdparty%2Fmkosi.git sandbox: use ValueError RuntimeError is for "unexpected errors". When the argument has a wrong value, ValueError is the standard exception to use. --- diff --git a/mkosi/sandbox.py b/mkosi/sandbox.py index b14662762..0df5aecfe 100755 --- a/mkosi/sandbox.py +++ b/mkosi/sandbox.py @@ -702,7 +702,7 @@ def main() -> None: elif arg == "--unshare-ipc": unshare_ipc = True elif arg.startswith("-"): - raise RuntimeError(f"Unrecognized option {arg}") + raise ValueError(f"Unrecognized option {arg}") else: argv.append(arg) break @@ -714,7 +714,7 @@ def main() -> None: # Make sure all destination paths are absolute. for fsop in fsops: if fsop.dst[0] != "/": - raise RuntimeError(f"{fsop.dst} is not an absolute path") + raise ValueError(f"{fsop.dst} is not an absolute path") fsops = FSOperation.optimize(fsops)