From 712549d83df937835fc1d136011bdaf9e6fb5ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Tue, 5 Aug 2025 23:34:17 -0300 Subject: [PATCH] fix: use stripe data to formate error message, log to sentry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/components/RegistrationLiteComponent.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/RegistrationLiteComponent.js b/src/components/RegistrationLiteComponent.js index e9e2deba..4a1fb4ca 100644 --- a/src/components/RegistrationLiteComponent.js +++ b/src/components/RegistrationLiteComponent.js @@ -138,7 +138,15 @@ const RegistrationLiteComponent = ({ title = 'Error'; break; } - Swal.fire(title, msg, icon) + + const stripeCode = exception?.error?.code || exception?.code; + const stripeMessage = exception?.error?.message || exception?.message || msg; + + const fullMsg = stripeCode ? `[${stripeCode}] ${stripeMessage}` : stripeMessage; + + Swal.fire(title, fullMsg, icon); + + Sentry.captureException(exception || new Error(fullMsg)); } const { getSettingByKey } = useMarketingSettings();