From 8e93dcfe80c9f6d0c31a351502f63807a5d218e1 Mon Sep 17 00:00:00 2001 From: Believethehype Date: Wed, 15 Mar 2023 00:52:28 +0100 Subject: [PATCH] error handling --- lnurl.go | 2 +- nostr.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lnurl.go b/lnurl.go index 81f1073..042162f 100644 --- a/lnurl.go +++ b/lnurl.go @@ -96,7 +96,7 @@ func handleLNURL(w http.ResponseWriter, r *http.Request) { return } - log.Info().Str("username", username).Str("domain", domain).Msg("got lnurl request") + log.Debug().Str("username", username).Str("domain", domain).Msg("got lnurl request") if amount := r.URL.Query().Get("amount"); amount == "" { // convert configured sendable amounts to integer diff --git a/nostr.go b/nostr.go index 021e8ca..29d6c95 100644 --- a/nostr.go +++ b/nostr.go @@ -89,6 +89,7 @@ func GetNostrProfileMetaData(npub string) (nostr.ProfileMetadata, error) { url := "wss://relay.damus.io" relay, err := nostr.RelayConnect(ctx, url) if err != nil { + cancel() return *metadata, err } @@ -104,6 +105,7 @@ func GetNostrProfileMetaData(npub string) (nostr.ProfileMetadata, error) { Limit: 1, }} } else { + cancel() return *metadata, err }