Skip to content

Commit

Permalink
Handle HTTP specific errors then other errors when downloading rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
askeing committed Apr 30, 2016
1 parent 55d14ff commit 3103cd4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/servo/bootstrap_commands.py
Expand Up @@ -63,11 +63,14 @@ def download(desc, src, writer, start_byte=0):

if not dumb:
print()
except urllib2.URLError:
print("Error downloading Rust compiler; are you connected to the internet?")
sys.exit(1)
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?")
sys.exit(1)
except KeyboardInterrupt:
writer.flush()
Expand Down

0 comments on commit 3103cd4

Please sign in to comment.