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

Function captureCause

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

Source from the content-addressed store, hash-verified

327};
328
329export const captureCause = (
330 input: unknown,
331 context: OtelCorrelationContext | null = null,
332): string | undefined => {
333 const { primary, pretty } = sentryPayloadForCause(input);
334 const classification = classificationTagsOf(input);
335 tagCurrentSentryScopeWithOtelContext(context);
336 return Sentry.captureException(primary, (scope) => {
337 tagSentryScopeWithOtelContext(scope, context);
338 for (const [key, value] of Object.entries(classification)) scope.setTag(key, value);
339 if (pretty !== null) scope.setExtra("cause", pretty);
340 return scope;
341 });
342};
343
344export const captureCauseEffect = (input: unknown): Effect.Effect<string | undefined> =>
345 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