lib/httpx/adapters/datadog.rb in httpx-0.17.0 vs lib/httpx/adapters/datadog.rb in httpx-0.18.0

- old
+ new

@@ -62,10 +62,10 @@ end def finish(response) return unless @span - if response.respond_to?(:error) + if response.is_a?(::HTTPX::ErrorResponse) @span.set_error(response.error) else @span.set_tag(Datadog::Ext::HTTP::STATUS_CODE, response.status.to_s) @span.set_error(::HTTPX::HTTPError.new(response)) if response.status >= 400 && response.status <= 599