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

Unified Diff: gm/rebaseline_server/imagediffdb.py

Issue 183833019: rebaseline_server: better reporting for bad URL fetch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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: gm/rebaseline_server/imagediffdb.py
diff --git a/gm/rebaseline_server/imagediffdb.py b/gm/rebaseline_server/imagediffdb.py
index f3347f75afe3f1f5410d13126dfb1cf41001dd79..a53eb1fb96d1c704fe9410be2bfbe8b22c54864a 100644
--- a/gm/rebaseline_server/imagediffdb.py
+++ b/gm/rebaseline_server/imagediffdb.py
@@ -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.
« 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