Sha256: ee2477cf3e833e0d108171ba533f43b793ae03ea7daac1f0622fabb19de31764

Contents?: true

Size: 806 Bytes

Versions: 8

Compression:

Stored size: 806 Bytes

Contents

module WatCatcher
  class BugsnagController < ActionController::Base
    skip_before_filter :verify_authenticity_token, only: :get, raise: false
    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

8 entries across 8 versions & 1 rubygems

Version Path
wat_catcher-0.10.10 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.9 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.8 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.7 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.6 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.5 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.4 app/controllers/wat_catcher/bugsnag_controller.rb
wat_catcher-0.10.3 app/controllers/wat_catcher/bugsnag_controller.rb