Index: chrome/common/extensions/docs/server2/schema_util.py |
diff --git a/chrome/common/extensions/docs/server2/schema_util.py b/chrome/common/extensions/docs/server2/schema_util.py |
index e9752e5ee8f314e2b91c01931e4ce0473346d7a4..dba7c7c7e8f01cf7abcc1c7a7953c935bedcdc61 100644 |
--- a/chrome/common/extensions/docs/server2/schema_util.py |
+++ b/chrome/common/extensions/docs/server2/schema_util.py |
@@ -3,6 +3,7 @@ |
# found in the LICENSE file. |
from collections import defaultdict, Mapping |
+import traceback |
from third_party.json_schema_compiler import json_parse, idl_schema, idl_parser |
@@ -111,7 +112,11 @@ def ProcessSchema(path, file_data): |
# Wrap the result in a list so that it behaves like JSON API data. |
return [trim_and_inline(idl.process()[0], is_idl=True)] |
- schemas = json_parse.Parse(file_data) |
+ try: |
+ schemas = json_parse.Parse(file_data) |
+ except: |
+ raise ValueError('Cannot parse "%s" as JSON:\n%s' % |
+ (path, traceback.format_exc())) |
for schema in schemas: |
# Schemas could consist of one API schema (data for a specific API file) |
# or multiple (data from extension_api.json). |