Sha256: 6a7f090b28450f33351da4f155775a65c8653b66a0f4193705655e3ed6e5481e

Contents?: true

Size: 524 Bytes

Versions: 10

Compression:

Stored size: 524 Bytes

Contents

module Kinu
  class BadRequestError < StandardError
    def initialize(response)
      @response = response
      @status = response.status
      super(response.headers['x-kinu-badrequest-reason'])
    end
  end

  class HttpError < StandardError
    attr_reader :status, :response

    def initialize(response)
      @response = response
      @status = response.status
      super("status: #{status}, response: #{response.body}")
    end
  end
  class ServerError < HttpError; end
  class ClientError < HttpError; end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kinu-2.0.2 lib/kinu/errors.rb
kinu-2.0.1 lib/kinu/errors.rb
kinu-2.0.0 lib/kinu/errors.rb
kinu-1.0.0.alpha7 lib/kinu/errors.rb
kinu-1.0.0.alpha6 lib/kinu/errors.rb
kinu-1.0.0.alpha5 lib/kinu/errors.rb
kinu-1.0.0.alpha4 lib/kinu/errors.rb
kinu-1.0.0.alpha3 lib/kinu/errors.rb
kinu-1.0.0.alpha2 lib/kinu/errors.rb
kinu-1.0.0.alpha1 lib/kinu/errors.rb