34 lines
916 B
Rust
34 lines
916 B
Rust
mod transaction;
|
|
pub use transaction::Transaction;
|
|
pub mod csv;
|
|
pub mod ynab;
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum Error {
|
|
#[error("HTTP Error: {0}")]
|
|
Http(#[from] reqwest::Error),
|
|
#[error("parse error: {0}")]
|
|
Parse(#[from] serde_json::Error),
|
|
#[error("csv error: {0}")]
|
|
Csv(#[from] ::csv::Error),
|
|
#[error("io error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
#[error("couldn't parse amount: {0}")]
|
|
AmountParse(#[from] std::num::ParseIntError),
|
|
|
|
#[error("plan not found: {0}")]
|
|
PlanNotFound(String),
|
|
#[error("account not found: {0}")]
|
|
AccountNotFound(String),
|
|
#[error("empty amount")]
|
|
AmountEmpty,
|
|
#[error("bank format not found: {0}")]
|
|
BankFormat(String),
|
|
#[error("API error {status}: {message}")]
|
|
ApiError { status: u16, message: String },
|
|
|
|
/// Errors I've been too lazy to give a type yet
|
|
#[error("{0}")]
|
|
Text(String),
|
|
}
|