Skip to content

Commit 31776e4

Browse files
authored
fix: propagate prompt errors (tailcallhq#583)
1 parent 47dd4db commit 31776e4

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎crates/forge_main/src/input.rs‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ impl UserInput for Console {
4444
let prompt: ForgePrompt = input.map(Into::into).unwrap_or_default();
4545

4646
loop {
47-
let result = engine.prompt(&prompt);
47+
let result = engine.prompt(&prompt)?;
4848
match result {
49-
Ok(ReadResult::Continue) => continue,
50-
Ok(ReadResult::Exit) => return Ok(Command::Exit),
51-
Ok(ReadResult::Empty) => continue,
52-
Ok(ReadResult::Success(text)) => {
49+
ReadResult::Continue => continue,
50+
ReadResult::Exit => return Ok(Command::Exit),
51+
ReadResult::Empty => continue,
52+
ReadResult::Success(text) => {
5353
tokio::spawn(
5454
crate::ui::TRACKER.dispatch(forge_tracker::EventKind::Prompt(text.clone())),
5555
);
@@ -64,9 +64,6 @@ impl UserInput for Console {
6464
}
6565
}
6666
}
67-
Err(e) => {
68-
CONSOLE.writeln(TitleFormat::failed(e.to_string()).format())?;
69-
}
7067
}
7168
}
7269
}

0 commit comments

Comments
 (0)