Skip to content

Commit 7e8a504

Browse files
authored
feat(order): add telemetry for order dialog errors (#780)
1 parent 74b7e24 commit 7e8a504

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/components/OrderDialog/InitialOrder.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Button } from "lib/components/ui/button"
22
import { Loader2 } from "lucide-react"
33
import { GitHubLogoIcon } from "@radix-ui/react-icons"
44
import { useEffect, useMemo, useState } from "react"
5+
import { useErrorTelemetry } from "lib/hooks/use-error-telemetry"
56
import VendorQuoteCard, { type OrderQuote } from "./VendorQuoteCard"
67
import { toast } from "lib/utils/toast"
78
import { getWindowVar } from "lib/utils/get-registry-ky"
@@ -44,6 +45,12 @@ export const InitialOrderScreen = ({
4445
// Poll for the order quote status
4546
const { data: orderQuote } = useOrderQuotePolling(orderQuoteId || undefined)
4647

48+
const errorMessage =
49+
(createOrderQuoteError && (createOrderQuoteError as any).error?.message) ||
50+
orderQuote?.error?.message
51+
52+
useErrorTelemetry({ errorMessage })
53+
4754
const redirectToStripeCheckout = async (orderQuoteId: string) => {
4855
const stripeCheckoutBaseUrl = getWindowVar(
4956
"TSCIRCUIT_STRIPE_CHECKOUT_BASE_URL",

0 commit comments

Comments
 (0)