Skip to content

Commit 2f6642f

Browse files
committed
feat: add error messages for CreateWithPersistError Display implementation
1 parent 946d454 commit 2f6642f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

crates/wallet/src/wallet/persisted.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,15 @@ pub enum CreateWithPersistError<E> {
363363
impl<E: fmt::Display> fmt::Display for CreateWithPersistError<E> {
364364
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
365365
match self {
366-
Self::Persist(err) => fmt::Display::fmt(err, f),
366+
Self::Persist(err) => write!(f, "Persistence error: {}", err),
367367
Self::DataAlreadyExists(changeset) => write!(
368368
f,
369369
"Cannot create wallet in persister which already contains wallet data: {:?}",
370370
changeset
371371
),
372-
Self::Descriptor(err) => fmt::Display::fmt(&err, f),
372+
Self::Descriptor(err) => {
373+
write!(f, "Cannot construct wallet from loaded changeset: {}", err)
374+
}
373375
}
374376
}
375377
}

0 commit comments

Comments
 (0)