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

Function getSimpleStatus

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

Source from the content-addressed store, hash-verified

333 * Convert the various statuses to the simple ones expected by Sentry for streamed spans ('ok' is default).
334 */
335export function getSimpleStatus(status: SpanStatus | undefined): 'ok' | 'error' {
336 return !status ||
337 status.code === SPAN_STATUS_OK ||
338 status.code === SPAN_STATUS_UNSET ||
339 status.message === 'cancelled'
340 ? 'ok'
341 : 'error';
342}
343
344/**
345 * Returns the span's attributes with the SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE attribute added

Callers 3

getStreamedSpanJSONMethod · 0.90
spanToStreamedSpanJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected