MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handleCheck

Function handleCheck

packages/react/src/components/accounts-section.tsx:99–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97 const expired = status === "expired";
98
99 const handleCheck = async () => {
100 if (checking) return;
101 setChecking(true);
102 const exit = await runCheck();
103 setChecking(false);
104 if (Exit.isFailure(exit)) {
105 toast.error(messageFromExit(exit, "Health check failed"));
106 return;
107 }
108 // The hook already folded the fresh probe into the live state.
109 if (exit.value.status === "healthy") {
110 toast.success(
111 exit.value.identity ? `Healthy: ${exit.value.identity}` : "Connection is healthy",
112 );
113 } else if (exit.value.status === "expired") {
114 toast.error("Connection expired, reconnect to restore access");
115 } else if (exit.value.status === "degraded") {
116 toast.warning(exit.value.detail ?? "Connection check returned an error");
117 } else {
118 toast.message("No health check is configured for this integration");
119 }
120 };
121
122 return (
123 <CardStackEntry className="flex-wrap items-start">

Callers 1

AccountRowFunction · 0.85

Calls 3

messageFromExitFunction · 0.90
errorMethod · 0.80
messageMethod · 0.45

Tested by

no test coverage detected