lib/raven/rack.rb in sentry-raven-0.9.4 vs lib/raven/rack.rb in sentry-raven-0.10.1
- old
+ new
@@ -19,23 +19,23 @@
# end
#
# Use a standard Raven.configure call to configure your server credentials.
class Rack
def self.capture_exception(exception, env, options = {})
- if env[:requested_at]
- options[:time_spent] = Time.now - env[:requested_at]
+ if env['requested_at']
+ options[:time_spent] = Time.now - env['requested_at']
end
Raven.capture_exception(exception, options) do |evt|
evt.interface :http do |int|
int.from_rack(env)
end
end
end
def self.capture_message(message, env, options = {})
- if env[:requested_at]
- options[:time_spent] = Time.now - env[:requested_at]
+ if env['requested_at']
+ options[:time_spent] = Time.now - env['requested_at']
end
Raven.capture_message(message, options) do |evt|
evt.interface :http do |int|
int.from_rack(env)
end
@@ -50,17 +50,18 @@
# 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['requested_at'] = Time.now
Raven.rack_context(env)
begin
response = @app.call(env)
rescue Error
raise # Don't capture Raven errors
rescue Exception => e
+ 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']