Ver código fonte

fix(cdk): improve error handling when adding mint to MultiMintWallet (#1099)

Add proper error handling and logging for add_mint operation instead of
propagating errors, preventing wallet operations from failing completely
when a mint cannot be added.
thesimplekid 3 semanas atrás
pai
commit
3ad860c908
1 arquivos alterados com 7 adições e 1 exclusões
  1. 7 1
      crates/cdk/src/wallet/multi_mint_wallet.rs

+ 7 - 1
crates/cdk/src/wallet/multi_mint_wallet.rs

@@ -242,7 +242,13 @@ impl MultiMintWallet {
             if mint_has_proofs_for_unit {
                 // Add mint to the MultiMintWallet if not already present
                 if !self.has_mint(&mint_url).await {
-                    self.add_mint(mint_url, None).await?;
+                    if let Err(err) = self.add_mint(mint_url.clone(), None).await {
+                        tracing::error!(
+                            "Could not add {} to wallet {}.",
+                            mint_url,
+                            err.to_string()
+                        );
+                    }
                 }
             }
         }