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

Function captureCause

apps/cloud/src/observability/index.ts:321–334  ·  view source on GitHub ↗
(
  input: unknown,
  context: OtelCorrelationContext | null = null,
)

Source from the content-addressed store, hash-verified

319};
320
321export const captureCause = (
322 input: unknown,
323 context: OtelCorrelationContext | null = null,
324): string | undefined => {
325 const { primary, pretty } = sentryPayloadForCause(input);
326 const classification = classificationTagsOf(input);
327 tagCurrentSentryScopeWithOtelContext(context);
328 return Sentry.captureException(primary, (scope) => {
329 tagSentryScopeWithOtelContext(scope, context);
330 for (const [key, value] of Object.entries(classification)) scope.setTag(key, value);
331 if (pretty !== null) scope.setExtra("cause", pretty);
332 return scope;
333 });
334};
335
336export const captureCauseEffect = (input: unknown): Effect.Effect<string | undefined> =>
337 Effect.gen(function* () {

Callers 4

server.tsFile · 0.90
toErrorResponseFunction · 0.90
toErrorServerResponseFunction · 0.90
captureCauseEffectFunction · 0.70

Calls 4

sentryPayloadForCauseFunction · 0.85
classificationTagsOfFunction · 0.85

Tested by

no test coverage detected