Sha256: 0d378c1c3295c2c7374c0d3c276154537eff70e2a55cca7e437b27bcda9df567

Contents?: true

Size: 429 Bytes

Versions: 2

Compression:

Stored size: 429 Bytes

Contents

# frozen_string_literal: true

module HTTPX
  Error = Class.new(StandardError)

  TimeoutError = Class.new(Error)

  ResolveError = Class.new(Error)

  HTTPError = Class.new(Error) do
    attr_reader :response

    def initialize(response)
      @response = response
      super("HTTP Error: #{@response.status}")
    end

    def status
      @response.status
    end
  end

  MisdirectedRequestError = Class.new(HTTPError)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
httpx-0.2.1 lib/httpx/errors.rb
httpx-0.2.0 lib/httpx/errors.rb