{"version":3,"file":"recordException-DTepFVfN.mjs","names":[],"sources":["../src/instrumentations/exceptions/recordException.ts"],"sourcesContent":["import { Attributes, SpanStatusCode, trace, Tracer } from '@opentelemetry/api';\n\nexport async function recordException(\n  error: unknown,\n  options?: {\n    tracer?: Tracer;\n    attributes?: Attributes;\n  },\n) {\n  const tracer = options?.tracer ?? trace.getTracer('@safaricom-mxl/node-sdk');\n  tracer.startActiveSpan('mxl.exception.record', (span) => {\n    span.recordException(error as Error);\n    span.setStatus({\n      code: SpanStatusCode.ERROR,\n      message: error instanceof Error ? error.message : String(error),\n    });\n    if (options?.attributes) {\n      span.setAttributes(options.attributes);\n    }\n    span.end();\n  });\n}\n"],"mappings":";;AAEA,eAAsB,gBACpB,OACA,SAIA;CAEA,CADe,SAAS,UAAU,MAAM,UAAU,yBAAyB,EAAA,CACpE,gBAAgB,yBAAyB,SAAS;EACvD,KAAK,gBAAgB,KAAc;EACnC,KAAK,UAAU;GACb,MAAM,eAAe;GACrB,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAChE,CAAC;EACD,IAAI,SAAS,YACX,KAAK,cAAc,QAAQ,UAAU;EAEvC,KAAK,IAAI;CACX,CAAC;AACH"}