trailbase_sqlite/error.rs
1#[derive(thiserror::Error, Debug)]
2pub enum Error {
3 #[error("Connection closed error")]
4 ConnectionClosed,
5
6 /// An error occured while closing the SQLite connection.
7 /// This `Error` variant contains the [`Connection`], which can be used to retry the close
8 /// operation and the underlying [`rusqlite::Error`] that made it impossible to close the
9 /// database.
10 #[error("Close error: {0}")]
11 Close(rusqlite::Error),
12
13 #[error("Rusqlite error: {0}")]
14 Rusqlite(#[from] rusqlite::Error),
15
16 #[error("SerdeRusqlite error: {0}")]
17 SerdeRusqlite(#[from] serde_rusqlite::Error),
18
19 #[error("Other error: {0}")]
20 Other(#[source] Box<dyn std::error::Error + Send + Sync + 'static>),
21}