improve error messages

This commit is contained in:
zappityzap 2025-01-05 10:07:47 -08:00
parent 81e7e920de
commit a99d25bf3c

View file

@ -95,7 +95,7 @@ class Nostr extends NotificationProvider {
const { data } = senderDecodeResult; const { data } = senderDecodeResult;
return data; return data;
} catch (error) { } catch (error) {
throw new Error(`Failed to get private key: ${error.message}`); throw new Error(`Failed to decode private key for sender ${sender}: ${error.message}`);
} }
} }
@ -114,10 +114,10 @@ class Nostr extends NotificationProvider {
if (type === "npub") { if (type === "npub") {
publicKeys.push(data); publicKeys.push(data);
} else { } else {
throw new Error("not an npub"); throw new Error(`Recipient ${recipient} is not an npub`);
} }
} catch (error) { } catch (error) {
throw new Error(`Error decoding recipient: ${error}`); throw new Error(`Error decoding recipient ${recipient}: ${error}`);
} }
} }
return publicKeys; return publicKeys;