1use std::io;
4use thiserror::Error;
5
6pub type Result<T> = std::result::Result<T, GuiError>;
8
9#[derive(Error, Debug)]
11pub enum GuiError {
12 #[error("IO error: {0}")]
14 Io(#[from] io::Error),
15
16 #[error("JSON error: {0}")]
18 Json(#[from] serde_json::Error),
19
20 #[error("Failed to bind socket: {0}")]
22 SocketBind(String),
23
24 #[error("Failed to connect to Termux GUI service")]
26 ConnectionFailed,
27
28 #[error("Invalid response: {0}")]
30 InvalidResponse(String),
31
32 #[error("View with ID {0} not found")]
34 ViewNotFound(i64),
35
36 #[error("Invalid view operation: {0}")]
38 InvalidOperation(String),
39
40 #[error("Event handling error: {0}")]
42 EventError(String),
43}