Skip to content

Commit f1393d9

Browse files
committed
move http status around
1 parent c029806 commit f1393d9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sentry_sdk/traces.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,14 @@ def set_status(self, status: "Union[SpanStatus, str]") -> None:
459459

460460
self.status = status
461461

462+
def set_http_status(self, http_status: int) -> None:
463+
self.set_attribute(SPANDATA.HTTP_STATUS_CODE, http_status)
464+
465+
if http_status >= 400:
466+
self.set_status(SpanStatus.ERROR)
467+
else:
468+
self.set_status(SpanStatus.OK)
469+
462470
def get_name(self) -> str:
463471
return self.name
464472

@@ -557,14 +565,6 @@ def _set_profile_id(self, profiler_id: "Optional[str]") -> None:
557565
if profiler_id is not None:
558566
self.set_attribute("sentry.profiler_id", profiler_id)
559567

560-
def set_http_status(self, http_status: int) -> None:
561-
self.set_attribute(SPANDATA.HTTP_STATUS_CODE, http_status)
562-
563-
if http_status >= 400:
564-
self.set_status(SpanStatus.ERROR)
565-
else:
566-
self.set_status(SpanStatus.OK)
567-
568568
def get_baggage(self) -> "Baggage":
569569
"""
570570
Return the :py:class:`~sentry_sdk.tracing_utils.Baggage` associated with

0 commit comments

Comments
 (0)