Sha256: e6b439c497518df25528b03da866709cb652beb1cbceda33c46d8b73ffdba097

Contents?: true

Size: 1.11 KB

Versions: 35

Compression:

Stored size: 1.11 KB

Contents

module HoptoadNotifier
  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_hoptoad, :rescue_action_locally)
        base.send(:alias_method, :rescue_action_locally, :rescue_action_locally_with_hoptoad)
      end

      private

      def rescue_action_locally_with_hoptoad(exception)
        result = rescue_action_locally_without_hoptoad(exception)

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

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

        result
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 6 rubygems

Version Path
hoptoad_notifier-2.3.6 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.5 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.4 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.3 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.2 lib/hoptoad_notifier/rails/error_lookup.rb
jordan-brough-hoptoad_notifier-2.3.0 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.0 lib/hoptoad_notifier/rails/error_lookup.rb
hatless-hoptoad_notifier-2.2.6.1 lib/hoptoad_notifier/rails/error_lookup.rb
hatless-hoptoad_notifier-2.2.6.001 lib/hoptoad_notifier/rails/error_lookup.rb
hatless-hoptoad_notifier-2.2.6 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.2.6 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.2.5 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.2.2 lib/hoptoad_notifier/rails/error_lookup.rb
errornot_notifier-0.1.0 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.2.0 lib/hoptoad_notifier/rails/error_lookup.rb