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
square-hoptoad_notifier-2.4.9 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.11 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.10 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.9 lib/hoptoad_notifier/rails/error_lookup.rb
square-hoptoad_notifier-2.4.8 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.8 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.7 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.6 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.5 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.4 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.2 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.1 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.4.0 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.12 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.11 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.10 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.9 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.8 lib/hoptoad_notifier/rails/error_lookup.rb
hoptoad_notifier-2.3.7 lib/hoptoad_notifier/rails/error_lookup.rb
riscfuture-hoptoad_notifier-2.3.6 lib/hoptoad_notifier/rails/error_lookup.rb