1pub mod auth;
6pub mod cache;
7pub mod client;
8pub mod commands;
9pub mod models;
10pub mod output;
11
12pub use auth::{get_token, has_token};
13pub use client::SocorroClient;
14pub use models::*;
15pub use output::OutputFormat;
16
17pub type Result<T> = std::result::Result<T, Error>;
18
19#[derive(thiserror::Error, Debug)]
20pub enum Error {
21 #[error("HTTP request failed: {0}")]
22 Http(#[from] reqwest::Error),
23
24 #[error("JSON error: {0}")]
25 Json(#[from] serde_json::Error),
26
27 #[error("Crash not found: {0}")]
28 NotFound(String),
29
30 #[error("Rate limited. Ask a human to run 'socorro-cli auth login' to set an API token that has no permissions attached to it")]
31 RateLimited,
32
33 #[error("Failed to parse response: {0}")]
34 ParseError(String),
35
36 #[error("Invalid crash ID format: {0}")]
37 InvalidCrashId(String),
38
39 #[error("Keyring error: {0}")]
40 Keyring(String),
41}