Skip to content

Commit

Permalink
Fail early if registry couldn't be queried
Browse files Browse the repository at this point in the history
  • Loading branch information
egfx-notifications committed Aug 19, 2021
1 parent aef205e commit 3c3f8bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,17 @@ fn get_sdk() -> io::Result<Vec<PathBuf>> {
.arg("/reg:32")
.output()?;

if !output.status.success() {
return Err(io::Error::new(
io::ErrorKind::Other,
format!(
"Querying the registry failed with error message:\n{}",
String::from_utf8(output.stderr)
.or_else(|e| Err(io::Error::new(io::ErrorKind::Other, e.to_string())))?
),
));
}

let lines = String::from_utf8(output.stdout)
.or_else(|e| Err(io::Error::new(io::ErrorKind::Other, e.to_string())))?;
let mut kits: Vec<PathBuf> = Vec::new();
Expand Down

0 comments on commit 3c3f8bc

Please sign in to comment.