(status: SpanStatus | undefined)
| 318 | |
| 319 | /** Get the status message to use for a JSON representation of a span. */ |
| 320 | export function getStatusMessage(status: SpanStatus | undefined): string | undefined { |
| 321 | if (!status || status.code === SPAN_STATUS_UNSET) { |
| 322 | return undefined; |
| 323 | } |
| 324 | |
| 325 | if (status.code === SPAN_STATUS_OK) { |
| 326 | return 'ok'; |
| 327 | } |
| 328 | |
| 329 | return status.message || 'internal_error'; |
| 330 | } |
| 331 | |
| 332 | /** |
| 333 | * Convert the various statuses to the simple ones expected by Sentry for streamed spans ('ok' is default). |
no outgoing calls
no test coverage detected