From 8e0a1fbfbfa80a8155e154f3265366c279595d9b Mon Sep 17 00:00:00 2001 From: ryanml Date: Mon, 3 Aug 2020 23:51:38 -0700 Subject: [PATCH] Fixes brave/brave-browser#11072 - Better handling for audit result --- script/audit_deps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/audit_deps.py b/script/audit_deps.py index 6eac8b04623..b1fee086dc0 100755 --- a/script/audit_deps.py +++ b/script/audit_deps.py @@ -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