rebaseline_server: better reporting for bad URL fetch

context: https://codereview.chromium.org/183763025/ ('vm_run_skia_try/write_json_summary: run skpdiff within imagediffdb, not on its own')

NOTREECHECKS=True
NOTRY=True
R=rmistry@google.com
TBR=rmistry

Author: epoger@google.com

Review URL: https://codereview.chromium.org/183833019

git-svn-id: http://skia.googlecode.com/svn/trunk@13654 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-03-04 16:46:22 +00:00
parent fbde87f53d
commit 8cc39a6567

View File

@ -91,14 +91,26 @@ class DiffRecord(object):
# TODO(rmistry): Add a parameter that makes _download_and_open_image raise
# an exception if images are not found locally (instead of trying to
# download them).
expected_image = _download_and_open_image(
os.path.join(storage_root, expected_images_subdir,
str(expected_image_locator) + image_suffix),
expected_image_url)
actual_image = _download_and_open_image(
os.path.join(storage_root, actual_images_subdir,
str(actual_image_locator) + image_suffix),
actual_image_url)
expected_image_file = os.path.join(
storage_root, expected_images_subdir,
str(expected_image_locator) + image_suffix)
actual_image_file = os.path.join(
storage_root, actual_images_subdir,
str(actual_image_locator) + image_suffix)
try:
expected_image = _download_and_open_image(
expected_image_file, expected_image_url)
except Exception:
logging.exception('unable to download expected_image_url %s to file %s' %
(expected_image_url, expected_image_file))
raise
try:
actual_image = _download_and_open_image(
actual_image_file, actual_image_url)
except Exception:
logging.exception('unable to download actual_image_url %s to file %s' %
(actual_image_url, actual_image_file))
raise
# Generate the diff image (absolute diff at each pixel) and
# max_diff_per_channel.