Skip to content

feat: user friendly stripe error message shown to user#92

Merged
joaquimds merged 1 commit into
masterfrom
feat/improve-stripe-user-error-message
May 7, 2026
Merged

feat: user friendly stripe error message shown to user#92
joaquimds merged 1 commit into
masterfrom
feat/improve-stripe-user-error-message

Conversation

@joaquimds
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to improve how Stripe-related errors are surfaced in the join flow UI by showing more user-friendly messages, while capturing more diagnostic context for failures.

Changes:

  • Updated usePostResource to throw an error with HTTP context and attach the raw response body onto the error object.
  • Added Stripe error formatting/mapping to display user-friendly messages for selected Stripe error codes and hide technical errors behind a generic message.
  • Updated the payment form UI to render the error message using Bootstrap “invalid-feedback” styling and added additional Sentry reporting for confirmPayment failures.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/join-flow/src/services/rest-resource.service.ts Changes thrown error shape/message for failed REST POSTs and attaches response body to the error object.
packages/join-flow/src/pages/payment-details.page.tsx Adds Stripe error-to-message formatting, logs confirmPayment errors to Sentry, and improves error message styling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (!res.ok) {
throw Error(await res.text());
const body = await res.text();
const err = new Error(`HTTP ${res.status} error from ${resource}`);
Comment on lines +432 to +435
Sentry.captureMessage("Stripe confirmPayment error", {
level: "error",
extra: { stripeError: error },
});
@joaquimds joaquimds force-pushed the feat/improve-stripe-user-error-message branch from 37f9347 to 5d8cc7b Compare May 7, 2026 10:53
@joaquimds joaquimds requested a review from Copilot May 7, 2026 10:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +22 to +24
const err = new Error(body) as Error & { status: number; resource: string };
err.status = res.status;
err.resource = resource;
Comment on lines 440 to 445
} catch (e: any) {
console.error("Create payment error", e);
handleError({ message: e?.message || JSON.stringify(e) || "Unknown error" });
Sentry.captureException(e)
Sentry.captureException(e);
setLoading(false);
setErrorMessage(GENERIC_PAYMENT_ERROR);
}
@joaquimds joaquimds merged commit 2751379 into master May 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants