convert rocksdb errors locally; remove from Error.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
c1712d4d8b
commit
01f4455ceb
6 changed files with 65 additions and 58 deletions
|
@ -25,12 +25,8 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
|
|||
|
||||
#[derive(Error)]
|
||||
pub enum Error {
|
||||
#[cfg(feature = "rocksdb")]
|
||||
#[error("There was a problem with the connection to the rocksdb database: {source}")]
|
||||
RocksDb {
|
||||
#[from]
|
||||
source: rust_rocksdb::Error,
|
||||
},
|
||||
#[error("{0}")]
|
||||
Database(String),
|
||||
#[error("Could not generate an image: {source}")]
|
||||
Image {
|
||||
#[from]
|
||||
|
@ -114,8 +110,7 @@ impl Error {
|
|||
let db_error = String::from("Database or I/O error occurred.");
|
||||
|
||||
match self {
|
||||
#[cfg(feature = "rocksdb")]
|
||||
Self::RocksDb {
|
||||
Self::Database {
|
||||
..
|
||||
} => db_error,
|
||||
Self::Io {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue