(traceId = "trace-xyz")
| 19 | // Recording ErrorCapture — returns a fixed trace id and accumulates |
| 20 | // every cause it sees in a Ref. |
| 21 | const makeRecorder = (traceId = "trace-xyz") => |
| 22 | Effect.gen(function* () { |
| 23 | const seen = yield* Ref.make<ReadonlyArray<Cause.Cause<unknown>>>([]); |
| 24 | const layer = Layer.succeed( |
| 25 | ErrorCapture, |
| 26 | ErrorCapture.of({ |
| 27 | captureException: (cause) => |
| 28 | Ref.update(seen, (prev) => [...prev, cause]).pipe(Effect.as(traceId)), |
| 29 | }), |
| 30 | ); |
| 31 | return { layer, seen }; |
| 32 | }); |
| 33 | |
| 34 | describe("capture", () => { |
| 35 | it.effect("translates StorageError to InternalError with ErrorCapture trace id", () => |
no test coverage detected