mirror of
https://github.com/lune-org/lune.git
synced 2025-04-20 03:43:49 +01:00
feat: proper error handling & error propagation
This commit is contained in:
parent
ad6b2a2364
commit
e1c316f20b
1 changed files with 6 additions and 6 deletions
|
@ -221,12 +221,12 @@ async fn spawn_command(
|
||||||
if let Some(stdin) = stdin {
|
if let Some(stdin) = stdin {
|
||||||
let mut child_stdin = child.stdin.take().unwrap();
|
let mut child_stdin = child.stdin.take().unwrap();
|
||||||
|
|
||||||
let stdin_writer_thread = task::spawn(async move {
|
let _ = task::spawn(async move {
|
||||||
let mut tee = AsyncTeeWriter::new(&mut child_stdin);
|
let mut tee = AsyncTeeWriter::new(&mut child_stdin);
|
||||||
tee.write_all(stdin.as_bytes()).await.unwrap();
|
tee.write_all(stdin.as_bytes()).await.into_lua_err()?;
|
||||||
});
|
|
||||||
|
|
||||||
stdin_writer_thread
|
Ok::<(), LuaError>(())
|
||||||
|
})
|
||||||
.await
|
.await
|
||||||
.expect("Tee writer for stdin errored");
|
.expect("Tee writer for stdin errored");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue