Skip to content

Commit 49146c7

Browse files
use Integer#between?
Co-authored-by: Kayla Reopelle <[email protected]>
1 parent d0daeab commit 49146c7

File tree

1 file changed

+1
-1
lines changed
  • instrumentation/httpx/lib/opentelemetry/instrumentation/httpx

1 file changed

+1
-1
lines changed

instrumentation/httpx/lib/opentelemetry/instrumentation/httpx/plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def finish(response, span)
5555
else
5656
span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE, response.status)
5757

58-
if response.status >= 400 && response.status <= 599
58+
if response.status.between?(400, 599)
5959
err = ::HTTPX::HTTPError.new(response)
6060
span.record_exception(err)
6161
span.status = Trace::Status.error(err.to_s)

0 commit comments

Comments
 (0)