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

Unified Diff: client/isolated_format.py

Issue 2993643002: Include more information when json parsing fails (Closed)
Patch Set: Created 3 years, 4 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: client/isolated_format.py
diff --git a/client/isolated_format.py b/client/isolated_format.py
index e71a4b5b19085b04d0afe83ffaaac388e8f9e835..6dc7336b49cdce354b59ae7a764da63c7ec47809 100644
--- a/client/isolated_format.py
+++ b/client/isolated_format.py
@@ -436,8 +436,8 @@ def load_isolated(content, algo):
"""
try:
data = json.loads(content)
- except ValueError:
- raise IsolatedError('Failed to parse: %s...' % content[:100])
+ except ValueError as v:
+ raise IsolatedError('Failed to parse (%s): %s...' % (v, content[:100]))
if not isinstance(data, dict):
raise IsolatedError('Expected dict, got %r' % data)
« 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