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(
31 "Rate limited. Ask a human to run 'socorro-cli auth login' to set an API token that has no permissions attached to it"
32 )]
33 RateLimited,
34
35 #[error("Failed to parse response: {0}")]
36 ParseError(String),
37
38 #[error("Invalid crash ID format: {0}")]
39 InvalidCrashId(String),
40
41 #[error("Keyring error: {0}")]
42 Keyring(String),
43}