Skip to main content

jtool_core/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum CoreError {
5    #[error("Configuration error: {0}")]
6    Config(String),
7
8    #[error("Server '{0}' not found in configuration")]
9    ServerNotFound(String),
10
11    #[error("No default server configured")]
12    NoDefaultServer,
13
14    #[error("Home directory not found")]
15    NoHomeDirectory,
16
17    #[error("I/O error: {0}")]
18    Io(#[from] std::io::Error),
19
20    #[error("Serialization error: {0}")]
21    Serialization(#[from] serde_json::Error),
22
23    #[error("TOML parsing error: {0}")]
24    TomlParse(#[from] toml::de::Error),
25
26    #[error("TOML serialization error: {0}")]
27    TomlSerialize(#[from] toml::ser::Error),
28
29    #[error("Session error: {0}")]
30    Session(String),
31}