aboutsummaryrefslogtreecommitdiffstats
path: root/src/tui.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tui.rs')
-rw-r--r--src/tui.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/tui.rs b/src/tui.rs
index 6708340..221604d 100644
--- a/src/tui.rs
+++ b/src/tui.rs
@@ -8,8 +8,8 @@ pub enum Error {
#[snafu(display("error during read: {}", source))]
Read { source: crate::readline::Error },
- #[snafu(display("error during eval: {}", source))]
- Eval { source: crate::eval::Error },
+ #[snafu(display("error from state: {}", source))]
+ State { source: crate::state::Error },
#[snafu(display("error during sending: {}", source))]
Sending {
@@ -41,14 +41,14 @@ pub fn tui() {
})
.then(move |res| match res {
// successful run or empty input means prompt again
- Ok(_)
- | Err(Error::Eval {
+ Ok(Ok(()))
+ | Ok(Err(crate::state::Error::Eval {
source:
crate::eval::Error::Parser {
source: crate::parser::Error::CommandRequired,
..
},
- }) => Ok(futures::future::Loop::Continue(idx + 1)),
+ })) => Ok(futures::future::Loop::Continue(idx + 1)),
// eof means we're done
Err(Error::Read {
source: crate::readline::Error::EOF,
@@ -59,6 +59,10 @@ pub fn tui() {
error(&e);
Ok(futures::future::Loop::Continue(idx + 1))
}
+ Ok(Err(e)) => {
+ error(&Error::State { source: e });
+ Ok(futures::future::Loop::Continue(idx + 1))
+ }
})
})
}));