(
error: unknown,
outcome: { readonly errorTag: string; readonly timedOut: boolean },
)
| 119 | * error reporter — see the call sites in `decide`. |
| 120 | */ |
| 121 | const failOpen = ( |
| 122 | error: unknown, |
| 123 | outcome: { readonly errorTag: string; readonly timedOut: boolean }, |
| 124 | ): Effect.Effect<GateDecision> => |
| 125 | Effect.gen(function* () { |
| 126 | yield* Effect.annotateCurrentSpan({ |
| 127 | "rate_limit.blocked": false, |
| 128 | "rate_limit.check.failed_open": true, |
| 129 | "rate_limit.check.timed_out": outcome.timedOut, |
| 130 | "rate_limit.check.error_tag": outcome.errorTag, |
| 131 | }); |
| 132 | yield* Effect.sync(() => { |
| 133 | console.warn("[rate-limit] execution rate limit check failed open:", error); |
| 134 | }); |
| 135 | if (!outcome.timedOut) yield* captureCauseEffect(error); |
| 136 | return { blocked: false } as const satisfies GateDecision; |
| 137 | }); |
| 138 | |
| 139 | /** Internal sentinel for an exemption lookup that exceeded its time budget. */ |
| 140 | class ExemptionCheckTimeoutError extends Data.TaggedError("ExemptionCheckTimeoutError")<{ |
no test coverage detected