SamplePackS
Convex Community2y ago
5 replies
SamplePack

useAction error handling

I see. So if my useAction errors though, its not obvious how to return that to the UI unless I am just wrapping in a try catch and returning the error as values?

I was thinking something like this:
const { data: paymentUrl, isLoading: paymentUrlLoading } = useQuery({
        queryKey: ["paymentUrl"],
        queryFn: useAction(api.stripe.getPaymentUrl),
  });
Was this page helpful?