From 94b14d1d83f80e2319437599156ad4448a39a873 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 20 Dec 2023 16:01:58 +0100 Subject: [PATCH] fix: only throw error message --- src/lib/stores/stripe.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/stores/stripe.ts b/src/lib/stores/stripe.ts index c0ba12ef81..4f81173de6 100644 --- a/src/lib/stores/stripe.ts +++ b/src/lib/stores/stripe.ts @@ -71,7 +71,7 @@ export async function submitStripeCard(name: string, urlRoute?: string) { if (error) { const e = new Error(error.message); trackError(e, Submit.PaymentMethodCreate); - throw error; + throw e; } if (setupIntent && setupIntent.status === 'succeeded') { @@ -87,11 +87,11 @@ export async function submitStripeCard(name: string, urlRoute?: string) { } else { const e = new Error('Something went wrong'); trackError(e, Submit.PaymentMethodCreate); - throw e; + throw e.message; } } catch (e) { trackError(e, Submit.PaymentMethodCreate); - throw e; + throw e.message; } } @@ -109,7 +109,7 @@ export async function confirmPayment(orgId: string, clientSecret: string, paymen } }); if (error) { - throw new Error(); + throw error.message; } } catch (e) { addNotification({