//! Core error type. use thiserror::Error; #[derive(Debug, Error)] pub enum CoreError { #[error(transparent)] Sqlite(#[from] rusqlite::Error), #[error(transparent)] Io(#[from] std::io::Error), #[error("http error: {0}")] Http(String), #[error("json error: {0}")] Json(#[from] serde_json::Error), #[error("cancelled")] Cancelled, #[error("{0}")] Other(String), } pub type Result = std::result::Result; impl From for CoreError { fn from(e: ureq::Error) -> Self { CoreError::Http(e.to_string()) } }