From 1f070f62f38a539337d93465d1180b723aac7726 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 19 Jan 2025 05:26:14 +0000 Subject: log zap failures --- bun.lockb | Bin 209762 -> 209762 bytes routes/nostr.ts | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/bun.lockb b/bun.lockb index acb87c96..480a5a31 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/routes/nostr.ts b/routes/nostr.ts index 2b47b834..f1b6a585 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -265,6 +265,7 @@ export default { }, async zap(req, res) { + try { const { event } = req.body; const amount = event.tags.find((t) => t[0] === "amount")[1]; const pubkey = event.tags.find((t) => t[0] === "p")[1]; @@ -273,8 +274,13 @@ export default { const url = new URL(callback); url.searchParams.set("amount", (amount * 1000).toString()); url.searchParams.set("nostr", JSON.stringify(event)); + console.log("URL", url.toString()); const json = await got(url.toString()).json(); res.send(json); + } catch(e) { + console.log(e); + bail(res, e.message); + } }, }; -- cgit v1.2.3