forked from silvermine/tauri-plugin-sqlite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.rs
More file actions
23 lines (18 loc) · 707 Bytes
/
Copy patherror.rs
File metadata and controls
23 lines (18 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Error types for sqlx-sqlite-conn-mgr
use thiserror::Error;
/// Errors that may occur when working with sqlx-sqlite-conn-mgr
#[derive(Error, Debug)]
pub enum Error {
/// IO error when accessing database files. Standard library IO errors
/// are converted to this variant.
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// Error from the sqlx library. Standard sqlx errors are converted to this variant
#[error("Sqlx error: {0}")]
Sqlx(#[from] sqlx::Error),
/// Database has been closed and cannot be used
#[error("Database has been closed")]
DatabaseClosed,
}
/// A type alias for Results with our Error type
pub type Result<T> = std::result::Result<T, Error>;