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

Function handleApiClientCause

packages/react/src/api/client.tsx:45–57  ·  view source on GitHub ↗
(cause: Cause.Cause<unknown>)

Source from the content-addressed store, hash-verified

43 });
44
45const handleApiClientCause = (cause: Cause.Cause<unknown>) =>
46 Effect.suspend(() => {
47 // A 401 is an expected, handled state — show the local login gate (or, on a
48 // hosted surface, the session re-auth). It is NOT an infrastructure error,
49 // so don't surface it as frontend telemetry: that was noise, and via
50 // globalThis.reportError it also tripped vite's dev error overlay, covering
51 // the gate. Other causes (schema/transport) still report.
52 if (isUnauthorizedCause(cause)) {
53 notifyLocalAuthRequired();
54 return Effect.void;
55 }
56 return reportApiClientInfrastructureCause(cause);
57 });
58
59// ---------------------------------------------------------------------------
60// Browser tracing — only when the build names an OTLP endpoint

Callers

nothing calls this directly

Calls 3

notifyLocalAuthRequiredFunction · 0.90
isUnauthorizedCauseFunction · 0.85

Tested by

no test coverage detected