From 52aaac349058d3e0df50a38ce35c10b5771dcfc2 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Mon, 29 Jul 2024 14:20:46 +0100 Subject: [PATCH] Fix a bug where the CLI would abort due a fatal error when an invalid configuration file path was provided (#1802) --- betty/cli/commands/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/betty/cli/commands/__init__.py b/betty/cli/commands/__init__.py index ca23c1736..f51c94db0 100644 --- a/betty/cli/commands/__init__.py +++ b/betty/cli/commands/__init__.py @@ -23,6 +23,8 @@ ) import click +from betty.cli.error import user_facing_error_to_value_proc +from betty.locale.localizer import DEFAULT_LOCALIZER from click import get_current_context, Context, option, Option, Parameter from typing_extensions import override @@ -360,7 +362,7 @@ def _project( "-c", "project", help="The path to a Betty project configuration file. Defaults to betty.json|yaml|yml in the current working directory.", - callback=_project, + callback=user_facing_error_to_value_proc(DEFAULT_LOCALIZER)(_project), )(f)