| Index: components/policy/resources/PRESUBMIT.py
|
| diff --git a/components/policy/resources/PRESUBMIT.py b/components/policy/resources/PRESUBMIT.py
|
| index 3870875aa379667a0dc5c6d59e95347b8e3934b3..e34e1acfd49cb448154ce5c0ea6dd484fcc2cbe2 100644
|
| --- a/components/policy/resources/PRESUBMIT.py
|
| +++ b/components/policy/resources/PRESUBMIT.py
|
| @@ -105,7 +105,11 @@ def _CommonChecks(input_api, output_api):
|
| template_path = os_path.join(local_path, 'policy_templates.json')
|
| affected_files = input_api.AffectedFiles()
|
| if any(f.AbsoluteLocalPath() == template_path for f in affected_files):
|
| - policies = _GetPolicyTemplates(template_path)
|
| + try:
|
| + policies = _GetPolicyTemplates(template_path)
|
| + except:
|
| + results.append(output_api.PresubmitError('Invalid Python/JSON syntax.'))
|
| + return results
|
| results.extend(_CheckPolicyTestCases(input_api, output_api, policies))
|
| results.extend(_CheckPolicyHistograms(input_api, output_api, policies))
|
|
|
|
|