Sha256: 10b5dd135e8d0e618c10790be65e0caac75f91da355b036fb1b64135b6205f42

Contents?: true

Size: 1.08 KB

Versions: 19

Compression:

Stored size: 1.08 KB

Contents

module Airbrake
  module Rails
    module ErrorLookup

      # Sets up an alias chain to catch exceptions when Rails does
      def self.included(base) #:nodoc:
        base.send(:alias_method, :rescue_action_locally_without_airbrake, :rescue_action_locally)
        base.send(:alias_method, :rescue_action_locally, :rescue_action_locally_with_airbrake)
      end

      private

      def rescue_action_locally_with_airbrake(exception)
        result = rescue_action_locally_without_airbrake(exception)

        if Airbrake.configuration.development_lookup
          path   = File.join(File.dirname(__FILE__), '..', '..', 'templates', 'rescue.erb')
          notice = Airbrake.build_lookup_hash_for(exception, airbrake_request_data)

          result << @template.render(
            :file          => path,
            :use_full_path => false,
            :locals        => { :host    => Airbrake.configuration.host,
                                :api_key => Airbrake.configuration.api_key,
                                :notice  => notice })
        end

        result
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
airbrake-3.1.6 lib/airbrake/rails/error_lookup.rb
airbrake-3.1.5 lib/airbrake/rails/error_lookup.rb
airbrake-3.1.4 lib/airbrake/rails/error_lookup.rb
airbrake-3.1.3 lib/airbrake/rails/error_lookup.rb
airbrake-3.1.2 lib/airbrake/rails/error_lookup.rb
airbrake-3.1.1 lib/airbrake/rails/error_lookup.rb
airbrake-3.1.0 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.9 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.8 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.7 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.6 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.5 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.4 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.3 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.2 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.1 lib/airbrake/rails/error_lookup.rb
airbrake-3.0 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.rc2 lib/airbrake/rails/error_lookup.rb
airbrake-3.0.rc1 lib/airbrake/rails/error_lookup.rb