lib/raven/integrations/rack.rb in sentry-raven-0.12.3 vs lib/raven/integrations/rack.rb in sentry-raven-0.13.0

- old
+ new

@@ -20,29 +20,22 @@ # end # # Use a standard Raven.configure call to configure your server credentials. class Rack - def self.capture_exception(exception, env, options = {}) + def self.capture_type(exception, env, options = {}) if env['requested_at'] options[:time_spent] = Time.now - env['requested_at'] end - Raven.capture_exception(exception, options) do |evt| + Raven.capture_type(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'] - end - Raven.capture_message(message, options) do |evt| - evt.interface :http do |int| - int.from_rack(env) - end - end + class << self + alias_method :capture_message, :capture_type + alias_method :capture_exception, :capture_type end def initialize(app) @app = app end