MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / captureEngineError

Function captureEngineError

packages/core/api/src/observability.ts:136–148  ·  view source on GitHub ↗
(
  eff: Effect.Effect<A, Cause.YieldableError, R>,
)

Source from the content-addressed store, hash-verified

134const isInternalError = Schema.is(InternalError);
135
136export 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

Callers 2

executions.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected