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

Unified Diff: appengine/findit/waterfall/swarming_util.py

Issue 2159023002: [Findit] Catch ValueError when get swarming result. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 5 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: appengine/findit/waterfall/swarming_util.py
diff --git a/appengine/findit/waterfall/swarming_util.py b/appengine/findit/waterfall/swarming_util.py
index d8cad51b9c39cc10c3c6fca143f51a0cd009ac7d..9adf9bc0536d3cffa9cf7b4ced35d83870893601 100644
--- a/appengine/findit/waterfall/swarming_util.py
+++ b/appengine/findit/waterfall/swarming_util.py
@@ -252,8 +252,10 @@ def _RetrieveOutputJsonFile(output_json_content, http_client):
get_content = base64.b64decode(json_content['content'])
else: # pragma: no cover
get_content = None # Just for precausion.
- return json.loads(zlib.decompress(get_content)) if get_content else None
-
+ try:
+ return json.loads(zlib.decompress(get_content)) if get_content else None
+ except ValueError:
+ return None
lijeffrey 2016/07/19 04:43:43 Do we want to add some logging that get_content is
chanli 2016/07/20 20:12:33 Done.
def _DownloadTestResults(isolated_data, http_client):
"""Downloads the output.json file and returns the json object."""
« 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