🐛 Allow Stripe Webhook creation if old does not exist anymore #2429

This commit is contained in:
Jan Oberhauser 2021-11-13 10:54:14 +01:00
parent 345c94bd37
commit 8427ade2e6

View file

@ -820,7 +820,7 @@ export class StripeTrigger implements INodeType {
try { try {
await stripeApiRequest.call(this, 'GET', endpoint, {}); await stripeApiRequest.call(this, 'GET', endpoint, {});
} catch (error) { } catch (error) {
if (error.message.includes('resource_missing')) { if (error.httpCode === '404' || error.message.includes('resource_missing')) {
// Webhook does not exist // Webhook does not exist
delete webhookData.webhookId; delete webhookData.webhookId;
delete webhookData.webhookEvents; delete webhookData.webhookEvents;