From 7bd57c602007ae4d7f0a1a7892fb194b4ffb6aa4 Mon Sep 17 00:00:00 2001 From: bogay Date: Fri, 22 Sep 2023 01:54:50 +0800 Subject: [PATCH] refactor(json_config): add parse error message from json lib --- commitizen/config/json_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commitizen/config/json_config.py b/commitizen/config/json_config.py index a22d3485d..5e821a5a9 100644 --- a/commitizen/config/json_config.py +++ b/commitizen/config/json_config.py @@ -47,8 +47,8 @@ def _parse_setting(self, data: bytes | str) -> None: """ try: doc = json.loads(data) - except json.JSONDecodeError: - raise InvalidConfigurationError(f"Failed to parse {self.path}") + except json.JSONDecodeError as e: + raise InvalidConfigurationError(f"Failed to parse {self.path}: {e}") try: self.settings.update(doc["commitizen"])