MCPcopy Create free account
hub / github.com/QuantiaAI/helm-agents / classifyError

Function classifyError

apps/web/src/lib/classify-error.ts:17–27  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

15};
16
17export function classifyError(raw: string): ErrKind {
18 const s = raw.toLowerCase();
19 // Auth first — a 401 with "network" in the text should still be auth.
20 if (/\b401\b|api[_ -]?key|unauthorized|incorrect api key|forbidden/.test(s)) return "auth";
21 // libuv connect family + generic network/timeout wording.
22 if (/fetch failed|econn|enotfound|etimedout|eai_again|ehostunreach|timed out|timeout|network|socket hang up|aborted/.test(s)) {
23 return "network";
24 }
25 if (/\b429\b|\brate[ _-]?limit\b|too many requests/.test(s)) return "ratelimit";
26 return "generic";
27}

Callers 2

showRunErrorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected