1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Clone, Debug, Error)]
10pub enum Error {
11 #[error("Network error: {0}")]
13 Network(String),
14
15 #[error("Authentication error: {0}")]
17 Authentication(String),
18
19 #[error("WatsonX API error: {0}")]
21 Api(String),
22
23 #[error("Timeout: {0}")]
25 Timeout(String),
26
27 #[error("Serialization error: {0}")]
29 Serialization(String),
30
31 #[error("Configuration error: {0}")]
33 Configuration(String),
34
35 #[error("Invalid input: {0}")]
37 InvalidInput(String),
38
39 #[error("Rate limit exceeded: {0}")]
41 RateLimit(String),
42
43 #[error("Model not found: {0}")]
45 ModelNotFound(String),
46
47 #[error("Project not found: {0}")]
49 ProjectNotFound(String),
50
51 #[error("I/O error: {0}")]
53 Io(String),
54}