Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: stripe webhooks with better logging

Marc Seitz7e0110c5de6e
diff --git a/pages/api/stripe/webhook.ts b/pages/api/stripe/webhook.ts
index 74f8bcd7..233ff651 100644
--- a/pages/api/stripe/webhook.ts
+++ b/pages/api/stripe/webhook.ts
@@ -187,10 +187,12 @@ export default async function webhookHandler(
throw new Error("Unhandled relevant event!");
}
} catch (error) {
- await log(`Stripe webook failed. Error: ${(error as Error).message}`);
- return res
- .status(400)
- .send('Webhook error: "Webhook handler failed. View logs."');
+ await log(
+ `Stripe webook failed for Event: *${event.type}* (_${
+ event.id
+ }_) \n\n Error: ${(error as Error).message}`,
+ );
+ return;
}
} else {
return res.status(400).send(`🤷‍♀️ Unhandled event type: ${event.type}`);