( eff: Effect.Effect<A, Cause.YieldableError, R>, )
| 134 | const isInternalError = Schema.is(InternalError); |
| 135 | |
| 136 | export const captureEngineError = <A, R>( |
| 137 | eff: Effect.Effect<A, Cause.YieldableError, R>, |
| 138 | ): Effect.Effect<A, InternalError, R> => |
| 139 | eff.pipe( |
| 140 | Effect.catch((err) => |
| 141 | isInternalError(err) |
| 142 | ? Effect.fail(err) |
| 143 | : resolveCapture.pipe( |
| 144 | Effect.flatMap((c) => c.captureException(Cause.fail(err))), |
| 145 | Effect.flatMap((traceId) => Effect.fail(new InternalError({ traceId }))), |
| 146 | ), |
| 147 | ), |
| 148 | ); |
| 149 | |
| 150 | /** |
| 151 | * Edge defect catchall. Builds an `HttpApiBuilder.middleware` layer |
no outgoing calls
no test coverage detected