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

Function classifyHttpStatus

packages/core/sdk/src/health-check.ts:143–147  ·  view source on GitHub ↗
(status: number)

Source from the content-addressed store, hash-verified

141/** Map an HTTP status to a health state: 2xx healthy, 401/403 expired (the auth
142 * wall), everything else degraded. */
143export const classifyHttpStatus = (status: number): HealthStatus => {
144 if (status >= 200 && status < 300) return "healthy";
145 if (status === 401 || status === 403) return "expired";
146 return "degraded";
147};
148
149/** Resolve a dot-path (`a.b.0.c`) against a JSON value and coerce the leaf to a
150 * display string. Numeric segments index arrays. Returns undefined when the

Callers 2

checkHealthOpenApiFunction · 0.90
mcpLivenessFailureStatusFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected