diff --git a/jrnl/install.py b/jrnl/install.py index ef0693ef..7f8b020e 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -78,8 +78,15 @@ def load_or_install_jrnl(alt_config_path): config = load_config(config_path) if config is None: - print("Unable to parse config file", file=sys.stderr) - sys.exit() + raise JrnlException( + Message( + MsgText.CantParseConfigFile, + MsgStyle.ERROR, + { + "config_path": config_path, + }, + ) + ) if is_old_version(config_path): from jrnl import upgrade diff --git a/jrnl/messages.py b/jrnl/messages.py index 7803a337..e2658ec3 100644 --- a/jrnl/messages.py +++ b/jrnl/messages.py @@ -121,6 +121,11 @@ class MsgText(Enum): Removing this file will allow jrnl to save its configuration. """ + CantParseConfigFile = """ + Unable to parse config file at: + {config_path} + """ + LineWrapTooSmallForDateFormat = """ The provided linewrap value of {config_linewrap} is too small by {columns} columns to display the timestamps in the configured time