logging in get_or_create_single_key

pull/19/head
Niko PLP 1 year ago
parent 20c0006600
commit 5c085b2ec7
  1. 2
      p2p-broker/src/broker_store/wallet.rs
  2. 6
      p2p-repo/src/store.rs

@ -11,6 +11,7 @@
use p2p_net::types::*;
use p2p_repo::kcv_store::KCVStore;
use p2p_repo::log::*;
use p2p_repo::store::*;
use p2p_repo::types::*;
use serde::{Deserialize, Serialize};
@ -53,6 +54,7 @@ impl<'a> Wallet<'a> {
if e == StorageError::NotFound {
self.create_single_key(prefix, key)
} else {
log_debug!("Error while creating single key {}", e);
Err(StorageError::BackendError)
}
}

@ -43,6 +43,12 @@ pub enum StorageError {
AlreadyExists,
}
impl core::fmt::Display for StorageError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}
impl From<serde_bare::error::Error> for StorageError {
fn from(e: serde_bare::error::Error) -> Self {
StorageError::SerializationError

Loading…
Cancel
Save