Bug 1361849 - Fix handling of HTTPError when the update snippet cannot be retrieved.
Re-raising an HTTPError with a modified reason would require 6 parameters
which we do not have at this point. So re-raise a normal Exception instead.
MozReview-Commit-ID: J9ws4IMDy3g
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/api/software_update.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/api/software_update.py
@@ -355,24 +355,23 @@ class SoftwareUpdate(BaseLib):
with open(os.path.join(self.staging_directory, 'update.status'), 'w') as f:
f.write('failed: 6\n')
def get_update_snippet(self, update_url):
"""Retrieve contents of the update snippet.
:param update_url: URL to the update snippet
"""
+ import urllib2
try:
- import urllib2
response = urllib2.urlopen(update_url)
return response.read()
- except Exception:
+ except urllib2.URLError:
exc, val, tb = sys.exc_info()
-
- raise exc, "Failed to retrieve update snippet: {}".format(val.reason), tb
+ raise Exception, "Failed to retrieve update snippet: {}".format(val), tb
def get_formatted_update_url(self, force=False):
"""Retrieve the formatted AUS update URL the update snippet is retrieved from.
:param force: Boolean flag to force an update check
:returns: The URL of the update snippet
"""