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

Function captureEngineError

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

Source from the content-addressed store, hash-verified

126const isInternalError = Schema.is(InternalError);
127
128export const captureEngineError = <A, R>(
129 eff: Effect.Effect<A, Cause.YieldableError, R>,
130): Effect.Effect<A, InternalError, R> =>
131 eff.pipe(
132 Effect.catch((err) =>
133 isInternalError(err)
134 ? Effect.fail(err)
135 : resolveCapture.pipe(
136 Effect.flatMap((c) => c.captureException(Cause.fail(err))),
137 Effect.flatMap((traceId) => Effect.fail(new InternalError({ traceId }))),
138 ),
139 ),
140 );
141
142/**
143 * Edge defect catchall. Builds an `HttpApiBuilder.middleware` layer

Callers 2

executions.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected