diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f7cd1b4..02b3e293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Changelog #### 1.1.0 * [New] JSON export exports tags as well. +* [Improved] Nicer error message when there is a syntactical error in your config file. + #### 1.0.5 * [Improved] Backwards compatibility with `parsedatetime` 0.8.7 diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 5b705d17..6f071a47 100755 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -150,7 +150,12 @@ def cli(): config = install.install_jrnl(CONFIG_PATH) else: with open(CONFIG_PATH) as f: - config = json.load(f) + try: + config = json.load(f) + except ValueError as e: + print("[There seems to be something wrong with your jrnl config at {}: {}]".format(CONFIG_PATH, e.message)) + print("[Entry was NOT added to your journal]") + sys.exit(-1) install.update_config(config, config_path=CONFIG_PATH) original_config = config.copy()