lib/raven/integrations/rack-timeout.rb in sentry-raven-3.0.4 vs lib/raven/integrations/rack-timeout.rb in sentry-raven-3.1.0

- old
+ new

@@ -8,10 +8,14 @@ module RackTimeoutExtensions def raven_context # Only rack-timeout 0.3.0+ provides the request environment, but we can't # gate this based on a gem version constant because rack-timeout does # not provide one. - { :fingerprint => ["{{ default }}", env["REQUEST_URI"]] } if defined?(env) + if defined?(env) + { :fingerprint => ["{{ default }}", env["REQUEST_URI"]] } + else + {} + end end end Rack::Timeout::Error.include(RackTimeoutExtensions) Rack::Timeout::RequestTimeoutException.include(RackTimeoutExtensions)