( input: unknown, context: OtelCorrelationContext | null = null, )
| 327 | }; |
| 328 | |
| 329 | export 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 | |
| 344 | export const captureCauseEffect = (input: unknown): Effect.Effect<string | undefined> => |
| 345 | Effect.gen(function* () { |
no test coverage detected