aboutsummaryrefslogtreecommitdiff
path: root/src/imap/session.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/imap/session.rs')
-rw-r--r--src/imap/session.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/imap/session.rs b/src/imap/session.rs
index 622a3f6..15141d3 100644
--- a/src/imap/session.rs
+++ b/src/imap/session.rs
@@ -140,7 +140,13 @@ impl Instance {
let res = match ctrl {
Ok((res, tr)) => {
//@FIXME remove unwrap
- self.state = self.state.apply(tr).unwrap();
+ self.state = match self.state.apply(tr) {
+ Ok(new_state) => new_state,
+ Err(e) => {
+ tracing::error!("Invalid transition: {}, exiting", e);
+ break;
+ }
+ };
//@FIXME enrich here the command with some global status