Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded error for downloading bogus versions #428
+18
−5
Conversation
brson
reviewed
May 10, 2016
src/rustup-dist/src/dist.rs
Outdated
| Ok(Some(hash)) => Ok(Some(hash)), | ||
| Err(Error(ErrorKind::Utils(rustup_utils::ErrorKind::Download404 { .. }), e)) => { | ||
| Err(Error(ErrorKind::Utils(rustup_utils::ErrorKind::Download404BadVers { vers: toolchain_str }), e)) | ||
| }, |
This comment has been minimized.
This comment has been minimized.
brson
May 10, 2016
Contributor
To get rid of some of this boilerplate how about something like
e @ Err(Error(ErrorKind::Utils(rustup_utils::ErrorKind::Download404 { .. }), _)) = {
e.chain_err(|| format!("could not download nonexistent rust version `{}`", toolchain_str)
}
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cramertj
force-pushed the
cramertj:master
branch
from
4f02826
to
36a3420
May 10, 2016
cramertj
force-pushed the
cramertj:master
branch
from
36a3420
to
0cba9cc
May 10, 2016
brson
merged commit a9fa226
into
rust-lang:master
May 10, 2016
This comment has been minimized.
This comment has been minimized.
|
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
cramertj commentedMay 10, 2016
Fixes #390
I'm not sure if this is exactly what you had in mind-- I didn't see quite how to compose it with
chain_errwithout catching all of the errors returned from the call toupdate_v1, but I got it working nonetheless.