Sha256: 0a0fffe727a0a9d5381ff9f37313fa1c110eebda6666cf34c436786b03869687

Contents?: true

Size: 698 Bytes

Versions: 13

Compression:

Stored size: 698 Bytes

Contents

module TestTrack::MisconfigurationNotifier
  class Wrapper
    attr_reader :underlying

    def initialize(underlying = Null.new)
      @underlying = underlying
    end

    def notify(msg)
      raise msg if Rails.env.development?

      Rails.logger.error(msg)

      underlying.notify(msg)
    end
  end

  class Null
    def notify(_); end
  end

  class Airbrake
    def notify(msg)
      raise "Aibrake was configured but not found" unless defined?(::Airbrake)

      if ::Airbrake.respond_to?(:notify_or_ignore)
        ::Airbrake.notify_or_ignore(StandardError.new, error_message: msg)
      else
        ::Airbrake.notify(StandardError.new, error_message: msg)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
test_track_rails_client-7.1.2 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-7.1.1 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-7.0.0 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-6.0.0 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-5.0.1 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-5.0.0 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-4.0.2 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-4.0.1 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-4.0.0 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-4.0.0.rc3 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-4.0.0.rc2 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-4.0.0.alpha35 app/models/test_track/misconfiguration_notifier.rb
test_track_rails_client-4.0.0.alpha34 app/models/test_track/misconfiguration_notifier.rb