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