diff --git a/platformio/util.py b/platformio/util.py index 20d6214a..4d345830 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -162,8 +162,12 @@ def singleton(cls): def load_json(file_path): - with open(file_path, "r") as f: - return json.load(f) + try: + with open(file_path, "r") as f: + return json.load(f) + except ValueError: + raise exception.PlatformioException("Could not load broken JSON: %s" % + file_path) def get_systype():