Skip to content

Commit

Permalink
Merge pull request #672 from appwrite/fix-sanitize-stripe-errors
Browse files Browse the repository at this point in the history
fix: only throw error message
  • Loading branch information
lohanidamodar authored Dec 20, 2023
2 parents 845a64d + 94b14d1 commit 4794793
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/stores/stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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;
}
}

Expand All @@ -109,7 +109,7 @@ export async function confirmPayment(orgId: string, clientSecret: string, paymen
}
});
if (error) {
throw new Error();
throw error.message;
}
} catch (e) {
addNotification({
Expand Down

1 comment on commit 4794793

@vercel
Copy link

@vercel vercel bot commented on 4794793 Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.