Skip to content

Commit

Permalink
Merge pull request #1380 from aimileus/unavailable-toolchain
Browse files Browse the repository at this point in the history
Give correct error message if user tries to install an unavailable toolchain
  • Loading branch information
Diggsey authored May 27, 2018
2 parents 09fb0f5 + d536825 commit 62c36af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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 @@ -558,7 +558,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

0 comments on commit 62c36af

Please sign in to comment.