Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error for downloading bogus versions #428

Merged
merged 1 commit into from May 10, 2016

Conversation

Projects
None yet
2 participants
@cramertj
Copy link
Member

cramertj commented May 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_err without catching all of the errors returned from the call to update_v1, but I got it working nonetheless.

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.

@brson

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.

@cramertj

cramertj May 10, 2016

Author Member

Ah, that's it! I was neglecting the @ syntax.

This comment has been minimized.

@cramertj

cramertj May 10, 2016

Author Member

Pushed the change.

@cramertj cramertj force-pushed the cramertj:master branch from 4f02826 to 36a3420 May 10, 2016

@cramertj cramertj force-pushed the cramertj:master branch from 36a3420 to 0cba9cc May 10, 2016

@brson brson merged commit a9fa226 into rust-lang:master May 10, 2016

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build cancelled
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@brson

This comment has been minimized.

Copy link
Contributor

brson commented May 10, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.