fix: improve extension startup error messages with command details (#2694)
Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -225,9 +225,22 @@ impl StdioTransport {
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
command.creation_flags(0x08000000); // CREATE_NO_WINDOW flag
|
command.creation_flags(0x08000000); // CREATE_NO_WINDOW flag
|
||||||
|
|
||||||
let mut process = command
|
let mut process = command.spawn().map_err(|e| {
|
||||||
.spawn()
|
let command = command.into_std();
|
||||||
.map_err(|e| Error::StdioProcessError(e.to_string()))?;
|
Error::StdioProcessError(format!(
|
||||||
|
"Could not run extension command (`{} {}`): {}",
|
||||||
|
command
|
||||||
|
.get_program()
|
||||||
|
.to_str()
|
||||||
|
.unwrap_or("[invalid command]"),
|
||||||
|
command
|
||||||
|
.get_args()
|
||||||
|
.map(|arg| arg.to_str().unwrap_or("[invalid arg]"))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(" "),
|
||||||
|
e
|
||||||
|
))
|
||||||
|
})?;
|
||||||
|
|
||||||
let stdin = process
|
let stdin = process
|
||||||
.stdin
|
.stdin
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ When the keyring is disabled, secrets are stored here:
|
|||||||
Many of the external extensions require a package runner. For example, if you run into an error like this one:
|
Many of the external extensions require a package runner. For example, if you run into an error like this one:
|
||||||
|
|
||||||
```
|
```
|
||||||
Failed to start extension: {extension name}, "No such file or directory (os error 2)"
|
Failed to start extension `{extension name}`: Could not run extension command (`{extension command}`): No such file or directory (os error 2)
|
||||||
Please check extension configuration for {extension name}.
|
Please check extension configuration for {extension name}.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user