Sentry/V8/Replace Span Status From Http Code
This codemod replaces spanStatusfromHttpCode with getSpanStatusFromHttpCode in Sentry 8.x. It transforms instances of spanStatusfromHttpCode to use the new getSpanStatusFromHttpCode function.
Example
Before
const spanStatus = spanStatusfromHttpCode(200);
After
const spanStatus = getSpanStatusFromHttpCode(200);
,
Before
const status1 = spanStatusfromHttpCode(404);const status2 = spanStatusfromHttpCode(500);
After
const status1 = getSpanStatusFromHttpCode(404);const status2 = getSpanStatusFromHttpCode(500);
,
Before
let currentStatus = spanStatusfromHttpCode(302);
After
let currentStatus = getSpanStatusFromHttpCode(302);
,
Before
logSpanStatus(spanStatusfromHttpCode(201));
After
logSpanStatus(getSpanStatusFromHttpCode(201));
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community