fix: Convert an error in webhook to info (#20806)
* Convert error to info * Convert error to info
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user