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

Give correct error message if user tries to install an unavailable toolchain #1380

Merged
merged 1 commit into from
May 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/rustup-cli/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ error_chain! {
description("toolchain is not installed")
display("toolchain '{}' is not installed", t)
}
InvalidToolchainName(t: String) {
description("invalid toolchain name")
display("invalid toolchain name: '{}'", t)
}
InfiniteRecursion {
description("infinite recursion detected")
}
Expand Down
2 changes: 1 addition & 1 deletion src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ fn update(cfg: &Cfg, m: &ArgMatches) -> Result<()> {
let status = if !toolchain.is_custom() {
Some(try!(toolchain.install_from_dist(m.is_present("force"))))
} else if !toolchain.exists() {
return Err(ErrorKind::ToolchainNotInstalled(toolchain.name().to_string()).into());
return Err(ErrorKind::InvalidToolchainName(toolchain.name().to_string()).into());
} else {
None
};
Expand Down