lib/opentelemetry/instrumentation/sinatra/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-sinatra-0.21.2 vs lib/opentelemetry/instrumentation/sinatra/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-sinatra-0.21.3
- old
+ new
@@ -29,10 +29,10 @@
span.name = env['sinatra.route'] if env['sinatra.route']
sinatra_response = ::Sinatra::Response.new([], response.first)
return unless sinatra_response.server_error?
- span.record_exception(env['sinatra.error'])
+ span.record_exception(env['sinatra.error']) if env['sinatra.error']
span.status = OpenTelemetry::Trace::Status.error
end
end
end
end