brson / multirust

[DEPRECATED] A tool for managing multiple Rust installations
658 stars 36 forks source link

Fail nicely when a wrong toolchain is requested #23

Open flaper87 opened 9 years ago

flaper87 commented 9 years ago
phantom ~ $ multirust update default
multirust: installing toolchain 'default'
multirust: gpg available. disabling https (avoids rust#21293)
multirust: interpreting toolchain spec as explicit version
multirust: downloading rust installer from 'http://static-rust-lang-org.s3-website-us-west-1.amazonaws.com/dist/rust-default-x86_64-unknown-linux-gnu.tar.gz'
multirust: downloading 'http://static-rust-lang-org.s3-website-us-west-1.amazonaws.com/dist/rust-default-x86_64-unknown-linux-gnu.tar.gz.sha256' to '/home/flaper87/.multirust/tmp/tmp-8059-1'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 404 Not Found
multirust: couldn't download checksum file 'http://static-rust-lang-org.s3-website-us-west-1.amazonaws.com/dist/rust-default-x86_64-unknown-linux-gnu.tar.gz.sha256'

I mistakenly did the above and multirust currently just fails to download the sha and exits. We should probably check nicely if the toolchain exists (probably execute a HEAD call to the sha url before downloading) and report an error if it doesn't.

brson commented 9 years ago

It's annoying, yeah. What you propose to fix it sounds reasonable.