chore: more error context for failed to open (#2215)

This commit is contained in:
Matthias Seitz
2023-04-12 18:10:52 +02:00
committed by GitHub
parent 48dc9987a1
commit a8665309fc
2 changed files with 3 additions and 3 deletions

View File

@@ -2,8 +2,8 @@
#[derive(Debug, thiserror::Error, PartialEq, Eq, Clone)]
pub enum Error {
/// Failed to open database.
#[error("{0:?}")]
DatabaseLocation(i32),
#[error("Failed to open database: {0:?}")]
FailedToOpen(i32),
/// Failed to create a table in database.
#[error("Table Creating error code: {0:?}")]
TableCreation(i32),

View File

@@ -74,7 +74,7 @@ impl<E: EnvironmentKind> Env<E> {
..Default::default()
})
.open(path)
.map_err(|e| Error::DatabaseLocation(e.into()))?,
.map_err(|e| Error::FailedToOpen(e.into()))?,
};
Ok(env)