lib/raven/integrations/rack.rb in sentry-raven-0.14.0 vs lib/raven/integrations/rack.rb in sentry-raven-0.15.0
- old
+ new
@@ -21,12 +21,12 @@
#
# Use a standard Raven.configure call to configure your server credentials.
class Rack
def self.capture_type(exception, env, options = {})
- if env['requested_at']
- options[:time_spent] = Time.now - env['requested_at']
+ if env['raven.requested_at']
+ options[:time_spent] = Time.now - env['raven.requested_at']
end
Raven.capture_type(exception, options) do |evt|
evt.interface :http do |int|
int.from_rack(env)
end
@@ -45,11 +45,11 @@
# clear context at the beginning of the request to ensure a clean slate
Context.clear!
# store the current environment in our local context for arbitrary
# callers
- env['requested_at'] = Time.now
+ env['raven.requested_at'] = Time.now
Raven.rack_context(env)
begin
response = @app.call(env)
rescue Error
@@ -58,10 +58,10 @@
Raven.logger.debug "Collecting %p: %s" % [ e.class, e.message ]
Raven::Rack.capture_exception(e, env)
raise
end
- error = env['rack.exception'] || env['sinatra.error']
+ error = env['rack.exception'] || env['sinatra.error'] || env['action_dispatch.exception']
Raven::Rack.capture_exception(error, env) if error
response
end