Skip to content

Commit

Permalink
log nip05 error
Browse files Browse the repository at this point in the history
Signed-off-by: kernelkind <kernelkind@gmail.com>
  • Loading branch information
kernelkind committed Jan 16, 2025
1 parent e4732f5 commit 26ed68a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/notedeck_columns/src/key_parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use ehttp::{Request, Response};
use enostr::{Keypair, Pubkey, SecretKey};
use poll_promise::Promise;
use serde::{Deserialize, Serialize};
use tracing::error;

#[derive(Debug, PartialEq, Clone)]
pub enum AcquireKeyError {
Expand Down Expand Up @@ -104,7 +105,11 @@ fn nip05_promise_wrapper(id: &str) -> Promise<Result<Keypair, AcquireKeyError>>
let result = original_promise.block_and_take();
let transformed_result = match result {
Ok(public_key) => Ok(Keypair::only_pubkey(public_key)),
Err(e) => Err(AcquireKeyError::Nip05Failed(e.to_string())),
Err(e) => {
let error_msg = e.to_string();
error!("Nip05 Failed: {}", error_msg);
Err(AcquireKeyError::Nip05Failed(error_msg))
}
};
sender.send(transformed_result);
});
Expand Down

0 comments on commit 26ed68a

Please sign in to comment.