( input: unknown, context: OtelCorrelationContext | null = null, )
| 319 | }; |
| 320 | |
| 321 | export 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 | |
| 336 | export const captureCauseEffect = (input: unknown): Effect.Effect<string | undefined> => |
| 337 | Effect.gen(function* () { |
no test coverage detected