Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit e231747

Browse files
committed
Convert errors
1 parent 6f0e3c9 commit e231747

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mutiny-core/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,12 +1428,13 @@ impl<S: MutinyStorage> MutinyWallet<S> {
14281428
let data: Vec<Value> = Self::primal_request(&client, url, body).await?;
14291429

14301430
if let Some(json) = data.first().cloned() {
1431-
let event: Event = serde_json::from_value(json)?;
1431+
let event: Event = serde_json::from_value(json).map_err(|_| MutinyError::NostrError)?;
14321432
if event.kind != Kind::Metadata {
14331433
return Ok(());
14341434
}
14351435

1436-
let metadata: Metadata = serde_json::from_str(&event.content)?;
1436+
let metadata: Metadata =
1437+
serde_json::from_str(&event.content).map_err(|_| MutinyError::NostrError)?;
14371438
self.storage.set_nostr_profile(metadata)?;
14381439
}
14391440

0 commit comments

Comments
 (0)