diff --git a/src/tools/rustdoc-gui-test/src/main.rs b/src/tools/rustdoc-gui-test/src/main.rs index f9929f1f80d4..dc902f8cb024 100644 --- a/src/tools/rustdoc-gui-test/src/main.rs +++ b/src/tools/rustdoc-gui-test/src/main.rs @@ -14,10 +14,16 @@ fn get_browser_ui_test_version_inner(npm: &Path, global: bool) -> Option if global { command.arg("--global"); } - let lines = command - .output() - .map(|output| String::from_utf8_lossy(&output.stdout).into_owned()) - .unwrap_or(String::new()); + let lines = match command.output() { + Ok(output) => String::from_utf8_lossy(&output.stdout).into_owned(), + Err(e) => { + eprintln!( + "path to npm can be wrong, provided path: {npm:?}. Try to set npm path \ + in config.toml in [build.npm]", + ); + panic!("{:?}", e) + } + }; lines .lines() .find_map(|l| l.rsplit(':').next()?.strip_prefix("browser-ui-test@"))