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

Commit

Permalink
Convert errors
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jan 26, 2024
1 parent 6f0e3c9 commit e231747
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1428,12 +1428,13 @@ impl<S: MutinyStorage> MutinyWallet<S> {
let data: Vec<Value> = Self::primal_request(&client, url, body).await?;

if let Some(json) = data.first().cloned() {
let event: Event = serde_json::from_value(json)?;
let event: Event = serde_json::from_value(json).map_err(|_| MutinyError::NostrError)?;
if event.kind != Kind::Metadata {
return Ok(());
}

let metadata: Metadata = serde_json::from_str(&event.content)?;
let metadata: Metadata =
serde_json::from_str(&event.content).map_err(|_| MutinyError::NostrError)?;
self.storage.set_nostr_profile(metadata)?;
}

Expand Down

0 comments on commit e231747

Please sign in to comment.