From d38aa2dd5fbd556d459bdc723f0fa4851e4e9bcd Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Fri, 23 Aug 2024 13:49:04 +0100 Subject: [PATCH] Do not show a stacktrace if we fail because we got too many args. The seed command expects only one positional arguments. If we got more than one, we should exit with a clean error message, instead of crashing with an uncaught exception and the associated stacktrace. --- odk/odk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odk/odk.py b/odk/odk.py index df63357f..406a2ba2 100755 --- a/odk/odk.py +++ b/odk/odk.py @@ -993,7 +993,7 @@ def seed(config, clean, outdir, templatedir, dependencies, title, user, source, mg = Generator() if len(repo) > 0: if len(repo) > 1: - raise Exception('max one repo; current={}'.format(repo)) + raise click.ClickException('max one repo; current={}'.format(repo)) repo = repo[0] else: repo = "noname"