use reqwest::StatusCode;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("finlight: Config.api_key is required")]
MissingApiKey,
#[error("finlight: API error: {status}")]
Api {
status: StatusCode,
body: String,
},
#[error("finlight: request failed: {0}")]
Http(#[from] reqwest::Error),
#[error("finlight: decode response: {0}")]
Decode(#[from] serde_json::Error),
#[error("finlight: connection rejected by server (blocked)")]
Blocked,
#[error("finlight: websocket error: {0}")]
WebSocket(String),
}
#[derive(Debug, thiserror::Error)]
#[error("{0}")]
pub struct WebhookVerificationError(pub(crate) String);