lib/opentelemetry/instrumentation/restclient/patches/request.rb in opentelemetry-instrumentation-restclient-0.22.2 vs lib/opentelemetry/instrumentation/restclient/patches/request.rb in opentelemetry-instrumentation-restclient-0.22.3

- old
+ new

@@ -47,15 +47,15 @@ yield(span).tap do |response| # Verify return value is a response. # If so, add additional attributes. if response.is_a?(::RestClient::Response) span.set_attribute('http.status_code', response.code) - span.status = OpenTelemetry::Trace::Status.error unless (100..399).include?(response.code.to_i) + span.status = OpenTelemetry::Trace::Status.error unless (100..399).cover?(response.code.to_i) end end rescue ::RestClient::ExceptionWithResponse => e span.set_attribute('http.status_code', e.http_code) - span.status = OpenTelemetry::Trace::Status.error unless (100..399).include?(e.http_code.to_i) + span.status = OpenTelemetry::Trace::Status.error unless (100..399).cover?(e.http_code.to_i) raise e ensure span.finish end