ra_cargo_watch: log more errors
This commit is contained in:
parent
fdb12f3e0e
commit
59ba386bee
@ -259,7 +259,7 @@ pub fn run_cargo(
|
|||||||
let mut child = command
|
let mut child = command
|
||||||
.args(args)
|
.args(args)
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.stderr(Stdio::null())
|
.stderr(Stdio::piped())
|
||||||
.stdin(Stdio::null())
|
.stdin(Stdio::null())
|
||||||
.spawn()
|
.spawn()
|
||||||
.expect("couldn't launch cargo");
|
.expect("couldn't launch cargo");
|
||||||
@ -352,8 +352,21 @@ impl WatchThread {
|
|||||||
// It is okay to ignore the result, as it only errors if the process is already dead
|
// It is okay to ignore the result, as it only errors if the process is already dead
|
||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
|
|
||||||
// Again, we don't care about the exit status so just ignore the result
|
// Again, we are resilient to errors, so we don't try to panic here
|
||||||
let _ = child.wait();
|
match child.wait_with_output() {
|
||||||
|
Ok(output) => match output.status.code() {
|
||||||
|
Some(0) | None => {}
|
||||||
|
Some(exit_code) => {
|
||||||
|
let output =
|
||||||
|
std::str::from_utf8(&output.stderr).unwrap_or("<bad utf8 output>");
|
||||||
|
|
||||||
|
if !output.contains("could not compile") {
|
||||||
|
log::error!("Cargo failed with exit code {} {}", exit_code, output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Err(err) => log::error!("Cargo io error: {:?}", err),
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user