fix: Convert an error in webhook to info (#20806)

* Convert error to info

* Convert error to info
This commit is contained in:
Hariom Balhara
2025-04-22 10:10:00 +05:30
committed by GitHub
parent 9dab915ddd
commit f163e4638b
@@ -49,14 +49,13 @@ const handler = async (data: SWHMap["invoice.paid"]["data"]) => {
);
if (!organizationOnboarding) {
logger.error(
`NonRecoverableError: No onboarding record found for stripe customer id: ${invoice.customer}.`
// Invoice Paid is received for all organizations, even those that were created before Organization Onboarding was introduced.
logger.info(
`No onboarding record found for stripe customer id: ${invoice.customer}, Organization created before Organization Onboarding was introduced, so ignoring the webhook`
);
// Don't throw as we don't want to retry.
return {
success: false,
error: `No onboarding record found for stripe customer id: ${invoice.customer}.`,
success: true,
};
}