(cause: Cause.Cause<unknown>)
| 44 | }); |
| 45 | |
| 46 | const 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 |
nothing calls this directly
no test coverage detected