lib/raven/rack.rb in sentry-raven-0.9.1 vs lib/raven/rack.rb in sentry-raven-0.9.2
- old
+ new
@@ -19,19 +19,23 @@
# end
#
# Use a standard Raven.configure call to configure your server credentials.
class Rack
def self.capture_exception(exception, env, options = {})
- 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 = {})
- 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
end