(span: Span, error: unknown)
| 3 | export { TracingSDK, type TracingSDKConfig, type TracingDiagnosticLogLevel } from "./tracingSDK"; |
| 4 | |
| 5 | export function recordSpanException(span: Span, error: unknown) { |
| 6 | if (error instanceof Error) { |
| 7 | span.recordException(error); |
| 8 | } else if (typeof error === "string") { |
| 9 | span.recordException(new Error(error)); |
| 10 | } else { |
| 11 | span.recordException(new Error(JSON.stringify(error))); |
| 12 | } |
| 13 | |
| 14 | span.setStatus({ code: SpanStatusCode.ERROR }); |
| 15 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…