@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 20 lines 731 Bytes
Raw
1 import * as Cause from "effect/Cause";
2 import * as Effect from "effect/Effect";
3
4 // Transport failures and response-read defects can retain the private lease header.
5 export const sanitizeExecFailure = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
6 effect.pipe(
7 Effect.catchCause((cause) =>
8 Effect.failCause(
9 Cause.fromReasons(
10 cause.reasons.map((reason) =>
11 Cause.isFailReason(reason)
12 ? Cause.makeFailReason(new Error("Fly exec lease probe failed"))
13 : Cause.isDieReason(reason)
14 ? Cause.makeDieReason(new Error("Fly exec lease probe defect"))
15 : Cause.makeInterruptReason(reason.fiberId),
16 ),
17 ),
18 ),
19 ),
20 );