(cause: unknown)
| 51 | const decodeCauseWithStatusOption = Schema.decodeUnknownOption(CauseWithStatusSchema); |
| 52 | |
| 53 | export 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, |
no outgoing calls
no test coverage detected