diff --git a/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-created.ts b/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-created.ts index d2709ab83..e93cfe3f1 100644 --- a/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-created.ts +++ b/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-created.ts @@ -5,6 +5,7 @@ import {loadSanityProduct} from './index' import {sanityWriteClient} from 'utils/sanity-server' import {SANITY_WEBHOOK_EVENT} from '../sanity-inngest-events' import {paymentOptions} from 'pages/api/skill/[...skillRecordings]' +import {NonRetriableError} from 'inngest' const stripe = paymentOptions.providers.stripe?.paymentClient @@ -16,7 +17,7 @@ export const sanityProductCreated = inngest.createFunction( }, async ({event, step}) => { if (!stripe) { - throw new Error('Payment provider (Stripe) is missing') + throw new NonRetriableError('Payment provider (Stripe) is missing') } const sanityProduct = await step.run('get sanity product', async () => { diff --git a/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-deleted.ts b/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-deleted.ts index 690bff6eb..7d24b8d3c 100644 --- a/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-deleted.ts +++ b/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-deleted.ts @@ -2,6 +2,7 @@ import {inngest} from 'inngest/inngest.server' import {prisma} from '@skillrecordings/database' import {SANITY_WEBHOOK_EVENT} from '../sanity-inngest-events' import {paymentOptions} from 'pages/api/skill/[...skillRecordings]' +import {NonRetriableError} from 'inngest' const stripe = paymentOptions.providers.stripe?.paymentClient @@ -13,7 +14,7 @@ export const sanityProductDeleted = inngest.createFunction( }, async ({event, step}) => { if (!stripe) { - throw new Error('Payment provider (Stripe) is missing') + throw new NonRetriableError('Payment provider (Stripe) is missing') } const {productId} = event.data diff --git a/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-updated.ts b/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-updated.ts index bdbd8eff1..d47ca1ea5 100644 --- a/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-updated.ts +++ b/apps/epic-web/src/inngest/functions/sanity/product/sanity-product-updated.ts @@ -4,6 +4,7 @@ import {v4} from 'uuid' import {loadSanityProduct} from './index' import {SANITY_WEBHOOK_EVENT} from '../sanity-inngest-events' import {paymentOptions} from 'pages/api/skill/[...skillRecordings]' +import {NonRetriableError} from 'inngest' const stripe = paymentOptions.providers.stripe?.paymentClient @@ -23,7 +24,7 @@ export const sanityProductUpdated = inngest.createFunction( }, async ({event, step}) => { if (!stripe) { - throw new Error('Payment provider (Stripe) is missing') + throw new NonRetriableError('Payment provider (Stripe) is missing') } const sanityProduct = await step.run('get sanity product', async () => { diff --git a/apps/epic-web/src/inngest/functions/stripe/webhook-received.ts b/apps/epic-web/src/inngest/functions/stripe/webhook-received.ts index de13ca447..c3d87d2f3 100644 --- a/apps/epic-web/src/inngest/functions/stripe/webhook-received.ts +++ b/apps/epic-web/src/inngest/functions/stripe/webhook-received.ts @@ -1,6 +1,5 @@ import {inngest} from 'inngest/inngest.server' import {STRIPE_WEBHOOK_RECEIVED_EVENT} from '@skillrecordings/inngest' -import {Redis} from '@upstash/redis' import {prisma} from '@skillrecordings/database' import {NonRetriableError} from 'inngest' import {postToSlack} from '@skillrecordings/skill-api' @@ -17,7 +16,7 @@ export const stripeWebhookReceived = inngest.createFunction( {event: STRIPE_WEBHOOK_RECEIVED_EVENT}, async ({event, step}) => { if (!stripe) { - throw new Error('Payment provider (Stripe) is missing') + throw new NonRetriableError('Payment provider (Stripe) is missing') } const stripeAccountId = await step.run(