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

Function handleCheck

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

Source from the content-addressed store, hash-verified

120 const missingOAuthScopes = connection.missingOAuthScopes ?? [];
121
122 const handleCheck = async () => {
123 if (checking) return;
124 setChecking(true);
125 const exit = await runCheck();
126 setChecking(false);
127 if (Exit.isFailure(exit)) {
128 toast.error(messageFromExit(exit, "Health check failed"));
129 return;
130 }
131 // The hook already folded the fresh probe into the live state.
132 if (exit.value.status === "healthy") {
133 toast.success(
134 exit.value.identity ? `Healthy: ${exit.value.identity}` : "Connection is healthy",
135 );
136 } else if (exit.value.status === "expired") {
137 toast.error("Connection expired, reconnect to restore access");
138 } else if (exit.value.status === "degraded") {
139 toast.warning(exit.value.detail ?? "Connection check returned an error");
140 } else {
141 toast.message("No health check is configured for this integration");
142 }
143 };
144
145 return (
146 <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