elaborate error macro and apply at various callsites
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
b3f2288d07
commit
05efd9b044
23 changed files with 161 additions and 140 deletions
|
@ -1,4 +1,4 @@
|
|||
use conduit::Result;
|
||||
use conduit::{err, Result};
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn result<T>(r: std::result::Result<T, rocksdb::Error>) -> Result<T, conduit::Error> {
|
||||
|
@ -10,4 +10,7 @@ pub(crate) fn and_then<T>(t: T) -> Result<T, conduit::Error> { Ok(t) }
|
|||
|
||||
pub(crate) fn or_else<T>(e: rocksdb::Error) -> Result<T, conduit::Error> { Err(map_err(e)) }
|
||||
|
||||
pub(crate) fn map_err(e: rocksdb::Error) -> conduit::Error { conduit::Error::Database(e.into_string()) }
|
||||
pub(crate) fn map_err(e: rocksdb::Error) -> conduit::Error {
|
||||
let string = e.into_string();
|
||||
err!(Database(error!("{string}")))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue