Adds extra logging for unhandled webhook events

This commit is contained in:
Mihovil Ilakovac 2025-04-17 13:46:59 +02:00
parent 8b0eae5cda
commit 4575008eb4
2 changed files with 2 additions and 0 deletions

View File

@ -43,6 +43,7 @@ export const lemonSqueezyWebhook: PaymentsWebhook = async (request, response, co
return response.status(200).json({ received: true });
} catch (err) {
if (err instanceof UnhandledWebhookEventError) {
console.error(err.message);
return response.status(422).json({ error: err.message });
}

View File

@ -51,6 +51,7 @@ export const stripeWebhook: PaymentsWebhook = async (request, response, context)
return response.json({ received: true }); // Stripe expects a 200 response to acknowledge receipt of the webhook
} catch (err) {
if (err instanceof UnhandledWebhookEventError) {
console.error(err.message);
return response.status(422).json({ error: err.message });
}