mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-04 13:41:31 +00:00
fix(zone-exec): catch panic errors and show all errors immediately (#359)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::Result;
|
||||
use async_stream::stream;
|
||||
use crossterm::{
|
||||
terminal::{disable_raw_mode, enable_raw_mode, is_raw_mode_enabled},
|
||||
@ -118,7 +118,12 @@ impl StdioConsoleStream {
|
||||
return if reply.error.is_empty() {
|
||||
Ok(reply.exit_code)
|
||||
} else {
|
||||
Err(anyhow!("exec failed: {}", reply.error))
|
||||
StdioConsoleStream::restore_terminal_mode();
|
||||
stderr
|
||||
.write_all(format!("Error: exec failed: {}\n", reply.error).as_bytes())
|
||||
.await?;
|
||||
stderr.flush().await?;
|
||||
Ok(-1)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user