use std::time::Duration;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum SignalWireError {
#[error("http transport error: {0}")]
Http(#[from] reqwest::Error),
#[error("unauthorized — bad project id or api key")]
Unauthorized,
#[error("not found: {0}")]
NotFound(String),
#[error("rate limited (retry_after={:?})", .0)]
RateLimited(Option<Duration>),
#[error("api error ({code}): {body}")]
Api { code: u16, body: String },
#[error("decode error: {source}; body={body}")]
Decode {
#[source]
source: serde_json::Error,
body: String,
},
}