MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getStatusMessage

Function getStatusMessage

packages/core/src/utils/spanUtils.ts:320–330  ·  view source on GitHub ↗
(status: SpanStatus | undefined)

Source from the content-addressed store, hash-verified

318
319/** Get the status message to use for a JSON representation of a span. */
320export 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).

Callers 4

getSpanJSONMethod · 0.90
spanToJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected