( read: Effect.Effect<A, WorkOSError>, )
| 43 | // A 404 is the deterministic "gone" the replay acts on; everything else |
| 44 | // fails the run (see the header). |
| 45 | const noneWhenGone = <A>( |
| 46 | read: Effect.Effect<A, WorkOSError>, |
| 47 | ): Effect.Effect<Option.Option<A>, WorkOSError> => |
| 48 | read.pipe( |
| 49 | Effect.map(Option.some), |
| 50 | Effect.catchTag("WorkOSError", (error) => |
| 51 | error.status === 404 ? Effect.succeed(Option.none<A>()) : Effect.fail(error), |
| 52 | ), |
| 53 | ); |
| 54 | |
| 55 | const replayDeps: Effect.Effect< |
| 56 | WorkOsEventsReplayDeps<SyncFailure>, |