convert rocksdb errors locally; remove from Error.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-12 01:08:07 +00:00
parent c1712d4d8b
commit 01f4455ceb
6 changed files with 65 additions and 58 deletions

View file

@ -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 {