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

Function statusFromWorkOSCause

apps/cloud/src/auth/errors.ts:53–57  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

51const decodeCauseWithStatusOption = Schema.decodeUnknownOption(CauseWithStatusSchema);
52
53export const statusFromWorkOSCause = (cause: unknown): number | undefined =>
54 Option.match(decodeCauseWithStatusOption(cause), {
55 onNone: () => undefined,
56 onSome: (decoded) => decoded.status,
57 });
58
59/**
60 * Build the public `WorkOSError` for a WorkOS service-adapter failure,

Callers 1

workosErrorFromFailureFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected