Skip to content

Commit

Permalink
Add context to sled db error
Browse files Browse the repository at this point in the history
  • Loading branch information
ktdlr committed Oct 22, 2024
1 parent 7b0d975 commit b53845d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ciphernode/data/src/into_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl IntoKey for Vec<u8> {
}
}

+/// Keys can be references to vectors of bytes (&Vec<u8>)
/// Keys can be references to vectors of bytes (&Vec<u8>)
impl IntoKey for &Vec<u8> {
fn into_key(self) -> Vec<u8> {
self.clone()
Expand Down
3 changes: 2 additions & 1 deletion packages/ciphernode/data/src/sled_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ impl Actor for SledStore {

impl SledStore {
pub fn new(bus: &Addr<EventBus>, path: &str) -> Result<Self> {
let db = sled::open(path).context("could not open db")?;
let db = sled::open(path)
.with_context(|| format!("Could not open database at path '{}'", path))?;
Ok(Self {
db,
bus: bus.clone(),
Expand Down

0 comments on commit b53845d

Please sign in to comment.