lib/appsignal/rack/sinatra_instrumentation.rb in appsignal-0.11.10 vs lib/appsignal/rack/sinatra_instrumentation.rb in appsignal-0.11.11
- old
+ new
@@ -17,9 +17,13 @@
# This information is available only after the
# request has been processed by Sinatra.
payload[:action] = env['sinatra.route']
end
end
+ ensure
+ # In production newer versions of Sinatra don't raise errors, but store
+ # them in the sinatra.error env var.
+ Appsignal::Transaction.current.add_exception(env['sinatra.error']) if env['sinatra.error']
end
def raw_payload(env)
request = @options.fetch(:request_class, ::Sinatra::Request).new(env)
params = request.public_send(@options.fetch(:params_method, :params))