Skip to main content

matchmaker/
errors.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4#[non_exhaustive]
5pub enum MatchError {
6    /// Exited via [`crate::action::Action::Quit`]
7    #[error("Aborted: {0}")]
8    Abort(i32),
9    /// Event loop closed
10    #[error("Event loop closed.")]
11    EventLoopClosed,
12    /// Exited via [`crate::action::Action::Become`]
13    #[error("Became: {0}")]
14    Become(String),
15    /// Critical error in TUI initialization/execution.
16    #[error("TUI Error: {0}")]
17    TUIError(String),
18    /// Specifically for [`crate::MatchResultExt::first`], this
19    /// error should not arise in normal execution
20    /// unless cursor is disabled when the render
21    /// loop exits with success status.
22    /// The cursor is never disabled in the binary crate.
23    #[error("no match")]
24    NoMatch,
25}
26
27pub type Result<T> = std::result::Result<T, MatchError>;