From 2cb3d505f0a650f45a36f7c10cf7af3f4556bc48 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Thu, 21 May 2026 13:23:06 -0700 Subject: [PATCH] =?UTF-8?q?chore(minting):=20TEMP=20=E2=80=94=20surface=20?= =?UTF-8?q?handler=20error=20msg=20+=20stack=20in=20500=20response?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Diagnostic patch for the active smoke test. Stripe webhook delivery is hitting the function (signature verifies — not 400) but throwing inside handleEvent → empty-body 500. Exposing the error message + first 5 stack frames so we can read it via the Stripe Dashboard delivery body. REVERT after smoke succeeds. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/minting-service/handlers/stripe-webhook.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/minting-service/handlers/stripe-webhook.ts b/apps/minting-service/handlers/stripe-webhook.ts index 50e7b588..ccafc821 100644 --- a/apps/minting-service/handlers/stripe-webhook.ts +++ b/apps/minting-service/handlers/stripe-webhook.ts @@ -71,8 +71,12 @@ export default async function handler(req: VercelRequest, res: VercelResponse): await handleEvent(event, deps); res.status(200).json({ received: true }); } catch (err) { + const msg = err instanceof Error ? `${err.name}: ${err.message}` : String(err); + const stack = err instanceof Error ? (err.stack ?? '').split('\n').slice(0, 5).join(' | ') : ''; console.error('webhook handler error', { eventId: event.id, type: event.type, err }); - res.status(500).send('internal error'); + // TEMP smoke diagnostic — surface error class + message + first stack frames so + // we can read it via curl/Stripe Dashboard delivery body. Revert after smoke. + res.status(500).send(`internal error: ${msg}\n${stack}`); } finally { await db.close(); }