Added error for downloading bogus versions#428
Merged
brson merged 1 commit intorust-lang:masterfrom May 10, 2016
Merged
Conversation
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)) | ||
| }, |
Contributor
There was a problem hiding this comment.
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)
}
Member
Author
There was a problem hiding this comment.
Ah, that's it! I was neglecting the @ syntax.
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.