1use std::io;
4use thiserror::Error;
5
6pub type Result<T> = std::result::Result<T, Error>;
8
9#[derive(Error, Debug)]
11pub enum Error {
12 #[error("Terminal I/O error: {0}")]
14 Io(#[from] io::Error),
15
16 #[error("Event processing error: {0}")]
18 EventProcessing(String),
19
20 #[error("UI rendering error: {0}")]
22 Rendering(String),
23
24 #[error("Channel error: {0}")]
26 Channel(String),
27
28 #[error("Invalid UI state: {0}")]
30 InvalidState(String),
31
32 #[error("Model selection error: {0}")]
34 ModelSelection(String),
35
36 #[error("Notification error: {0}")]
38 Notification(String),
39
40 #[error("Command processing error: {0}")]
42 CommandProcessing(String),
43
44 #[error("Operation timed out: {0}")]
46 Timeout(String),
47
48 #[error("{0}")]
50 Generic(String),
51
52 #[error("Configuration error: {0}")]
54 Config(String),
55
56 #[error("Authentication error: {0}")]
58 Auth(String),
59
60 #[error("gRPC error: {0}")]
62 Grpc(#[from] Box<steer_grpc::GrpcError>),
63
64 #[error("TUI command parsing error: {0}")]
66 TuiCommandParsing(#[from] crate::tui::commands::TuiCommandError),
67}
68
69impl From<steer_grpc::GrpcError> for Error {
70 fn from(err: steer_grpc::GrpcError) -> Self {
71 Error::Grpc(Box::new(err))
72 }
73}