(cause: unknown)
| 165 | const decodeCauseWithStatusOption = Schema.decodeUnknownOption(CauseWithStatusSchema); |
| 166 | |
| 167 | export const statusFromWorkOSCause = (cause: unknown): number | undefined => |
| 168 | Option.match(decodeCauseWithStatusOption(cause), { |
| 169 | onNone: () => undefined, |
| 170 | onSome: (decoded) => decoded.status, |
| 171 | }); |
| 172 | |
| 173 | /** |
| 174 | * Build the public `WorkOSError` for a WorkOS service-adapter failure, |
no outgoing calls
no test coverage detected