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

Function captureEngineError

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

Source from the content-addressed store, hash-verified

115const isInternalError = Schema.is(InternalError);
116
117export const captureEngineError = <A, R>(
118 eff: Effect.Effect<A, Cause.YieldableError, R>,
119): Effect.Effect<A, InternalError, R> =>
120 eff.pipe(
121 Effect.catch((err) =>
122 isInternalError(err)
123 ? Effect.fail(err)
124 : resolveCapture.pipe(
125 Effect.flatMap((c) => c.captureException(Cause.fail(err))),
126 Effect.flatMap((traceId) => Effect.fail(new InternalError({ traceId }))),
127 ),
128 ),
129 );
130
131/**
132 * Edge defect catchall. Builds an `HttpApiBuilder.middleware` layer

Callers 1

executions.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected