synchronizator/cli/src/error.rs

33 lines
No EOL
683 B
Rust

use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("{0}")]
Exception(&'static str),
#[error("{0}")]
Runtime(String),
#[error("{0}")]
Unhandled(&'static str),
#[error(transparent)]
Sync(#[from] lib_sync_core::error::Error),
#[error(transparent)]
Sqlx(#[from] sqlx::Error),
#[error(transparent)]
Migration(#[from] sqlx::migrate::MigrateError),
#[error(transparent)]
Io(#[from] tokio::io::Error),
#[error(transparent)]
ParseJson(#[from] serde_json::Error),
#[error(transparent)]
Config(#[from] figment::Error),
}
pub type Result<T> = std::result::Result<T, Error>;