servo: Merge #11525 - Provide a better error message when downloading rustc fails (from perlun:better-error-when-rustc-download-fails); r=jdm
authorPer Lundberg <per.lundberg@ecraft.com>
Wed, 01 Jun 2016 08:24:56 -0500
changeset 338976 3bb9e01e7c7b993fa829903af97c2ac16a2bc3a3
parent 338975 dd747f278fc40be1e92f81225d036982fd0a5da1
child 338977 76c9d689f11a68934cd6ccc0c3f92c9895b1db29
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
servo: Merge #11525 - Provide a better error message when downloading rustc fails (from perlun:better-error-when-rustc-download-fails); r=jdm I was running into the error below locally. The previous version of the code hid away important details that helps when debugging; hence, this suggested change. > Error downloading Rust compiler: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590). URL: https://static-rust-lang-org.s3.amazonaws.com/dist/2016-05-17/rustc-nightly-x86_64-pc-windows-gnu.tar.gz Source-Repo: https://github.com/servo/servo Source-Revision: 8d7ceae1515057afc21c5c2e15d8e8d3683a16ce
servo/python/servo/bootstrap_commands.py
--- a/servo/python/servo/bootstrap_commands.py
+++ b/servo/python/servo/bootstrap_commands.py
@@ -64,18 +64,18 @@ def download(desc, src, writer, start_by
         if not dumb:
             print()
     except urllib2.HTTPError, e:
         print("Download failed (%d): %s - %s" % (e.code, e.reason, src))
         if e.code == 403:
             print("No Rust compiler binary available for this platform. "
                   "Please see https://github.com/servo/servo/#prerequisites")
         sys.exit(1)
-    except urllib2.URLError:
-        print("Error downloading Rust compiler; are you connected to the internet?")
+    except urllib2.URLError, e:
+        print("Error downloading Rust compiler: " + str(e.reason) + ". The failing URL was: " + src)
         sys.exit(1)
     except KeyboardInterrupt:
         writer.flush()
         raise
 
 
 def download_file(desc, src, dst):
     tmp_path = dst + ".part"