Sha256: b2d53eb0f1aaf39409c14c871547a734f3e0bcdd9c099dba59f141575a50fd0c

Contents?: true

Size: 900 Bytes

Versions: 19

Compression:

Stored size: 900 Bytes

Contents

class BeforeNotifyController < ActionController::Base
  protect_from_forgery
  before_bugsnag_notify :add_diagnostics_to_bugsnag

  def handled
    Bugsnag.before_notify_callbacks << Proc.new do |report|
      report.add_tab(:before_notify, {
        :source => "rails_before_handled"
      })
    end
    Bugsnag.notify("handled string")
    render json: {}
  end

  def unhandled
    Bugsnag.before_notify_callbacks << Proc.new do |report|
      report.add_tab(:before_notify, {
        :source => "rails_before_unhandled"
      })
    end
    generate_unhandled_error
  end

  def inline
    Bugsnag.notify("handled string") do |report|
      report.add_tab(:before_notify, {
        :source => "rails_inline"
      })
    end
    render json: {}
  end

  private

  def add_diagnostics_to_bugsnag(report)
    report.add_tab(:controller, {
      :name => "BeforeNotifyController"
    })
  end
end

Version data entries

19 entries across 12 versions & 1 rubygems

Version Path
bugsnag-6.15.0 features/fixtures/rails6/app/app/controllers/before_notify_controller.rb
bugsnag-6.15.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.14.0 features/fixtures/rails6/app/app/controllers/before_notify_controller.rb
bugsnag-6.14.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.1 features/fixtures/rails6/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.1 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.0 features/fixtures/rails6/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.2 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.2 features/fixtures/rails6/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.1 features/fixtures/rails6/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.1 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.0 features/fixtures/rails6/app/app/controllers/before_notify_controller.rb
bugsnag-6.11.1 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.11.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.10.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.9.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb
bugsnag-6.8.0 features/fixtures/rails5/app/app/controllers/before_notify_controller.rb