Sha256: b0fba28373edf4bd9347b0d454d6e72514b88a826b2e9e8405bc18c33c0df66e

Contents?: true

Size: 341 Bytes

Versions: 14

Compression:

Stored size: 341 Bytes

Contents

require 'faraday'

module AirbrakeAPI
  module Middleware
    class RaiseServerError < Faraday::Response::Middleware

      def on_complete(env)
        case env[:status].to_i
        when 403
          raise AirbrakeError.new('SSL should be enabled - use AirbrakeAPI.secure = true in configuration')
        end
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
airbrake-api-4.6.1 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.6.0 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.5.1 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.5.0 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.4.0 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.3.0 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.2.2 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.2.1 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.2.0 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.1.3 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.1.2 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.1.1 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.1.0 lib/airbrake-api/middleware/raise_server_error.rb
airbrake-api-4.0.0 lib/airbrake-api/middleware/raise_server_error.rb