Sha256: babb1e8f0aa583153f7872ff8c3e35b667be6d9d3a532b3a37392f07aad4e55c

Contents?: true

Size: 666 Bytes

Versions: 6

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

module Flipper
  module Notifications
    module Webhooks
      class ApiError < StandardError

        def initialize(response)
          @response = response
        end

        def message
          "Webhook API call resulted in #{@response.code} response: #{@response.body}"
        end

      end

      class ClientError < ApiError; end

      class ServerError < ApiError; end

      class NetworkError < ApiError

        def initialize(cause)
          @cause = cause
        end

        def message
          "Webhook API call network error: #{cause.class.name} - #{cause.message}"
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flipper-notifications-0.1.6 lib/flipper/notifications/webhooks/errors.rb
flipper-notifications-0.1.5 lib/flipper/notifications/webhooks/errors.rb
flipper-notifications-0.1.4 lib/flipper/notifications/webhooks/errors.rb
flipper-notifications-0.1.3 lib/flipper/notifications/webhooks/errors.rb
flipper-notifications-0.1.2 lib/flipper/notifications/webhooks/errors.rb
flipper-notifications-0.1.1 lib/flipper/notifications/webhooks/errors.rb