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

Function handleApiClientCause

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

Source from the content-addressed store, hash-verified

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