Skip to main content

seher/claude/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum ClaudeApiError {
5    #[error("HTTP request error: {0}")]
6    RequestError(#[from] reqwest::Error),
7
8    #[error("JSON parse error: {0}")]
9    ParseError(#[from] serde_json::Error),
10
11    #[error("Cookie not found: {0}")]
12    CookieNotFound(String),
13
14    #[error("API error (status {status}): {body}")]
15    ApiError { status: u16, body: String },
16}
17
18pub type Result<T> = std::result::Result<T, ClaudeApiError>;