Skip to main content

obol_core/
error.rs

1use std::path::PathBuf;
2
3#[derive(Debug, thiserror::Error)]
4pub enum ObolError {
5    #[error("pricing tables not found at {0} — run `obol refresh`")]
6    PricingTablesMissing(PathBuf),
7    #[error("could not determine transcript dialect")]
8    UnknownDialect,
9    #[error("invalid as_of {0:?} — expected YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ (UTC)")]
10    InvalidAsOf(String),
11    #[error("malformed transcript at line {line}: {msg}")]
12    MalformedTranscript { line: usize, msg: String },
13    #[error("network error during refresh: {0}")]
14    Network(String),
15    #[error(transparent)]
16    Io(#[from] std::io::Error),
17    #[error("json error: {0}")]
18    Json(#[from] serde_json::Error),
19}