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

Function isUnauthorizedCause

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

Source from the content-addressed store, hash-verified

35 });
36
37const isUnauthorizedCause = (cause: Cause.Cause<unknown>): boolean =>
38 Option.match(Cause.findErrorOption(cause), {
39 onNone: () => false,
40 onSome: (error) =>
41 HttpClientError.isHttpClientError(error) &&
42 "response" in error &&
43 (error as { readonly response?: { readonly status?: number } }).response?.status === 401,
44 });
45
46const handleApiClientCause = (cause: Cause.Cause<unknown>) =>
47 Effect.suspend(() => {

Callers 1

handleApiClientCauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected