diff --git a/p2p-broker/src/broker_store/wallet.rs b/p2p-broker/src/broker_store/wallet.rs index a7b6e2b..8b0fc34 100644 --- a/p2p-broker/src/broker_store/wallet.rs +++ b/p2p-broker/src/broker_store/wallet.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) } } diff --git a/p2p-repo/src/store.rs b/p2p-repo/src/store.rs index 5ed81fe..0ee6c2c 100644 --- a/p2p-repo/src/store.rs +++ b/p2p-repo/src/store.rs @@ -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 for StorageError { fn from(e: serde_bare::error::Error) -> Self { StorageError::SerializationError