forgetop_core/error.rs
1//! Core error type shared across the app.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum Error {
7 /// A provider/network call failed.
8 #[error("provider error: {0}")]
9 Provider(String),
10
11 /// Configuration or binding problem.
12 #[error("config error: {0}")]
13 Config(String),
14
15 /// Requested entity was not found.
16 #[error("not found: {0}")]
17 NotFound(String),
18
19 #[error(transparent)]
20 Io(#[from] std::io::Error),
21
22 #[error(transparent)]
23 Json(#[from] serde_json::Error),
24}
25
26pub type Result<T> = std::result::Result<T, Error>;