| 1 |
|
| 2 |
|
| 3 |
#[derive(Debug, thiserror::Error)] |
| 4 |
pub enum SyncError { |
| 5 |
#[error("database error: {0}")] |
| 6 |
Db(#[from] rusqlite::Error), |
| 7 |
#[error("sync client error: {0}")] |
| 8 |
Client(String), |
| 9 |
#[error("auth error: {0}")] |
| 10 |
Auth(String), |
| 11 |
#[error("I/O error: {0}")] |
| 12 |
Io(#[from] std::io::Error), |
| 13 |
#[error("{0}")] |
| 14 |
Other(String), |
| 15 |
} |
| 16 |
|
| 17 |
impl From<synckit_client::SyncKitError> for SyncError { |
| 18 |
fn from(e: synckit_client::SyncKitError) -> Self { |
| 19 |
SyncError::Client(e.to_string()) |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
pub type Result<T> = std::result::Result<T, SyncError>; |
| 24 |
|