Skip to content

Commit

Permalink
Merge pull request #18 from craigcomstock/CFE-3757
Browse files Browse the repository at this point in the history
CFE-3757: Make invalid json error easier to read
  • Loading branch information
olehermanse committed Sep 21, 2021
2 parents 9fbc9c5 + 30e389d commit 176173d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cfbs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def read_json(path):
return json.loads(f.read(), object_pairs_hook=OrderedDict)
except FileNotFoundError:
return None
except json.decoder.JSONDecodeError as ex:
print("Error reading json file {} : {}".format(path, ex))
sys.exit(1)


def write_json(path, data):
Expand Down

0 comments on commit 176173d

Please sign in to comment.