refactor: move library into it's own crate

This commit is contained in:
Alexander Navarro 2025-05-15 11:38:00 -04:00
parent 91d702088d
commit b31502fb37
13 changed files with 138 additions and 34 deletions

33
cli/src/error.rs Normal file
View file

@ -0,0 +1,33 @@
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>;