The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
skip non-force payout failures with a warning instead of throwing
Kiran K0369283e5c2b
diff --git a/apps/web/lib/partners/create-stablecoin-payout.ts b/apps/web/lib/partners/create-stablecoin-payout.tsindex 974403b7de..73d6352881 100644--- a/apps/web/lib/partners/create-stablecoin-payout.ts+++ b/apps/web/lib/partners/create-stablecoin-payout.ts@@ -216,9 +216,14 @@ export const createStablecoinPayout = async ({await markPayoutsAsProcessed(currentInvoicePayouts);- throw new Error(- `Stripe recipient account for partner ${partner.email} does not have crypto wallet capabilities.`,- );+ const message = `Stripe recipient account for partner ${partner.email} does not have crypto wallet capabilities.`;++ if (forceWithdrawal) {+ throw new Error(message);+ } else {+ console.warn(message);+ return;+ }}const allPayoutsProgramNames = [diff --git a/apps/web/lib/partners/create-stripe-transfer.ts b/apps/web/lib/partners/create-stripe-transfer.tsindex 3b3a6b73bf..f0b88adea3 100644--- a/apps/web/lib/partners/create-stripe-transfer.ts+++ b/apps/web/lib/partners/create-stripe-transfer.ts@@ -48,9 +48,10 @@ export const createStripeTransfer = async ({// should never happen, but just in caseif (!partner.stripeConnectId || !partner.payoutsEnabledAt) {- throw new Error(- `Partner ${partner.email} does not have an active payout account`,+ console.warn(+ `Partner ${partner.email} does not have an active payout account.`,);+ return;}const commonInclude: Prisma.PayoutInclude = {@@ -179,9 +180,14 @@ export const createStripeTransfer = async ({await markPayoutsAsProcessed(currentInvoicePayouts);- throw new Error(- `Partner's Stripe Express account (${partner.stripeConnectId}) is not configured to receive transfers`,- );+ const message = `Partner's Stripe Express account (${partner.stripeConnectId}) is not configured to receive transfers`;++ if (forceWithdrawal) {+ throw new Error(message);+ } else {+ console.warn(message);+ return;+ }}// will be used for transfer_group