MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / handleError

Function handleError

src/hooks/use-upgrade-modal.tsx:8–16  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

6 const [open, setOpen] = useState(false);
7
8 const handleError = (error: unknown) => {
9 if (error instanceof TRPCClientError) {
10 if (error.data?.code === "FORBIDDEN") {
11 setOpen(true);
12 return true;
13 }
14 }
15 return false;
16 };
17
18 const modal = <UpgradeModal open={open} onOpenChange={setOpen} />;
19

Callers 2

onSubmitFunction · 0.85
handleCreateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected