Sha256: bf0fe58ce85ef84ac0581e9f6a8717ccae8ead5c458b5259877f86d4d47740bd

Contents?: true

Size: 939 Bytes

Versions: 24

Compression:

Stored size: 939 Bytes

Contents

class BeforeNotifyController < ActionController::Base
  protect_from_forgery
  before_bugsnag_notify :add_diagnostics_to_bugsnag

  def index
    render json: {}
  end

  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

24 entries across 12 versions & 1 rubygems

Version Path
bugsnag-6.15.0 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.15.0 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.14.0 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.14.0 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.1 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.1 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.0 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.13.0 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.2 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.2 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.1 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.1 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.0 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.12.0 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.11.1 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.11.1 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.11.0 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.11.0 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb
bugsnag-6.10.0 features/fixtures/rails3/app/app/controllers/before_notify_controller.rb
bugsnag-6.10.0 features/fixtures/rails4/app/app/controllers/before_notify_controller.rb