1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum ClickUpError {
8 #[error("HTTP request failed: {0}")]
10 HttpError(#[from] reqwest::Error),
11
12 #[error("ClickUp API error (status {status}): {message}")]
14 ApiError { status: u16, message: String },
15
16 #[error("Authentication failed: {0}")]
18 AuthError(String),
19
20 #[error("JSON parsing failed: {0}")]
22 JsonError(#[from] serde_json::Error),
23
24 #[error("Resource not found: {0}")]
26 NotFound(String),
27
28 #[error("Configuration error: {0}")]
30 ConfigError(String),
31
32 #[error("Operation timeout: {0}")]
34 Timeout(String),
35
36 #[error("Validation error: {0}")]
38 ValidationError(String),
39}
40
41pub type Result<T> = std::result::Result<T, ClickUpError>;