Skip to main content

socorro_cli/
lib.rs

1pub mod client;
2pub mod commands;
3pub mod models;
4pub mod output;
5
6pub use client::SocorroClient;
7pub use models::*;
8pub use output::OutputFormat;
9
10pub type Result<T> = std::result::Result<T, Error>;
11
12#[derive(thiserror::Error, Debug)]
13pub enum Error {
14    #[error("HTTP request failed: {0}")]
15    Http(#[from] reqwest::Error),
16
17    #[error("JSON error: {0}")]
18    Json(#[from] serde_json::Error),
19
20    #[error("Crash not found: {0}")]
21    NotFound(String),
22
23    #[error("Rate limited. Try using an API token with --token or SOCORRO_API_TOKEN")]
24    RateLimited,
25
26    #[error("Failed to parse response: {0}")]
27    ParseError(String),
28
29    #[error("Invalid crash ID format: {0}")]
30    InvalidCrashId(String),
31}