Sha256: 58007f24c2c10e9e8784f7412bc46d348444c6eac951063ce04d7087b362b2e9

Contents?: true

Size: 792 Bytes

Versions: 17

Compression:

Stored size: 792 Bytes

Contents

module WatCatcher
  class BugsnagController < ActionController::Base
    skip_before_filter :verify_authenticity_token, only: :get
    include WatCatcher::CatcherOfWats

    def show
      request.params[:wat] = HashWithIndifferentAccess.new
      request.params[:wat][:backtrace] = stacktrace
      request.params[:wat][:message] = params[:message]
      request.params[:wat][:page_url] = params[:url]
      request.params[:wat][:language] = 'javascript'

      begin
        user = JSON.parse(params[:user])
      rescue JSON::ParserError;end
    ensure
      @report = Report.new(nil, user: user, request: request)
      response.headers['Content-Type'] = "image/png; charset=utf-8"
      head :ok
    end

    def stacktrace
      params[:stacktrace].split("\n")[1..-1]
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
wat_catcher-0.10.2 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.1 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.0 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.9.0 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.9 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.8 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.7 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.6 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.5 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.4 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.3 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.2 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.1 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.8.0 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.7.2 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.7.1 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.7.0 app/controllers/wat_catcher/bugsnag_controller.rb