Fixes brave/brave-browser#11072 - Better handling for audit result

This commit is contained in:
ryanml
2020-08-03 23:57:44 -07:00
parent ee9d056593
commit 8e0a1fbfbf
+2 -1
View File
@@ -81,7 +81,8 @@ def npm_audit_deps(path, args):
try:
# results from audit
result = json.loads(output.decode('UTF-8'))
except ValueError:
assert 'actions' in result
except (ValueError, AssertionError):
# This can happen in the case of an NPM network error
print('Audit failed to return valid json')
return 1