evault_tui/error.rs
1//! Error type surfaced by the TUI runtime.
2
3use thiserror::Error;
4
5use crate::provider::ProviderError;
6
7/// Top-level error type returned by [`crate::run_tui`].
8///
9/// Wraps the two failure surfaces of the runtime: terminal I/O
10/// (raw-mode toggling, drawing, event reading) and the caller-supplied
11/// [`crate::VarProvider`].
12#[non_exhaustive]
13#[derive(Error, Debug)]
14pub enum TuiError {
15 /// Terminal I/O failed — raw-mode toggling, drawing to the
16 /// framebuffer, or reading an event.
17 #[error("terminal io error: {0}")]
18 Terminal(#[from] std::io::Error),
19
20 /// The data provider returned an error while the dashboard was
21 /// refreshing.
22 #[error("provider error: {0}")]
23 Provider(#[from] ProviderError),
24}