Commit 9b3e5ba4 authored by erikchen's avatar erikchen Committed by Commit Bot

Gracefully handle missing files in compare_build_artifacts.

If files are specified by a .isolate and missing, this should be handled like
any other error in compare_build_artifacts. It should not throw an exception.

Bug: 870731
Change-Id: If29a180539ffa148d5788ac2ecd626205e2eb090
Reviewed-on: https://chromium-review.googlesource.com/1183998Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584939}
parent b9b8c24e
......@@ -155,6 +155,12 @@ def compare_files(first_filepath, second_filepath):
Returns None if the files are equal, a string otherwise.
"""
if not os.path.exists(first_filepath):
return 'file does not exist %s' % first_filepath
if not os.path.exists(second_filepath):
return 'file does not exist %s' % second_filepath
if first_filepath.endswith('.isolated'):
with open(first_filepath, 'rb') as f:
lhs = json.load(f)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment