Sha256: 6d326c0fdeddcb754dded10c52c16ea47dd43abfdd83680a013afe6604c6e7b0

Contents?: true

Size: 661 Bytes

Versions: 7

Compression:

Stored size: 661 Bytes

Contents

module Goalie
  class CustomErrorPages
    alias_method :orig_render_exception, :render_exception
    
    private

    def render_exception(env, exception)
      begin
        controller = env['action_controller.instance']
        request_data = controller.try(:ratchetio_request_data)
        person_data = controller.try(:ratchetio_person_data)
        Ratchetio.report_exception(exception, request_data, person_data)
      rescue => e
        # TODO use logger here?
        puts "[Ratchet.io] Exception while reporting exception to Ratchet.io: #{e}" 
      end

      # now continue as normal
      orig_render_exception(env, exception)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ratchetio-0.5.0 lib/ratchetio/goalie.rb
ratchetio-0.4.11 lib/ratchetio/goalie.rb
ratchetio-0.4.10 lib/ratchetio/goalie.rb
ratchetio-0.4.9 lib/ratchetio/goalie.rb
ratchetio-0.4.8 lib/ratchetio/goalie.rb
ratchetio-0.4.7 lib/ratchetio/goalie.rb
ratchetio-0.4.6 lib/ratchetio/goalie.rb