Skip to content

Commit 12bb16c

Browse files
committed
Capture exception when recurring totals do not exist
1 parent d0973e3 commit 12bb16c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

services/backend-api/client/src/pages/Checkout.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,19 @@ export const Checkout = ({ cancelUrl }: Props) => {
129129
? dayjs().add(1, checkoutData.item.interval).format("D MMM YYYY")
130130
: todayFormatted;
131131

132+
const checkoutDataExists = !!checkoutData;
133+
const checkoutRecurringTotalsExist = !!checkoutData?.recurringTotals;
134+
135+
useEffect(() => {
136+
if (checkoutDataExists && !checkoutRecurringTotalsExist) {
137+
captureException(new Error("Recurring totals do not exist"), {
138+
extra: {
139+
checkoutData,
140+
},
141+
});
142+
}
143+
}, [checkoutRecurringTotalsExist, checkoutDataExists]);
144+
132145
return (
133146
<DashboardContentV2 error={error} loading={false}>
134147
<BoxConstrained.Wrapper>

0 commit comments

Comments
 (0)