logging in get_or_create_single_key

Niko PLP 1 year ago
parent 5cf6af6458
commit d1bf0a85d4
  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