Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: PRESUBMIT.py

Issue 255613002: Add detail to 'invalid JSON' message in PRESUBMIT.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy-list-doc
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 8a6454358882c90b10928d80b7300d602e7f01c6..3c1b7ff9fde749fa54dd63239a193a5090878ded 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1069,9 +1069,10 @@ def _CheckJSONParsability(input_api, output_api):
with open(fpath.LocalPath(), 'r') as f:
try:
input_api.json.load(f)
- except ValueError:
+ except ValueError as e:
results.append(output_api.PresubmitError(
- "File %r does not parse as valid JSON" % (fpath.LocalPath())
+ "File %r does not parse as valid JSON:\n %s"
+ % (fpath.LocalPath(), e.args[0])
))
return results
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698