Sha256: 8388766b56b294fa8fa3543c3e522eca0e0deefeac916aeb67368e28b36ea189

Contents?: true

Size: 613 Bytes

Versions: 8

Compression:

Stored size: 613 Bytes

Contents

module Pingpp
  class PingppError < StandardError
    attr_reader :message
    attr_reader :http_status
    attr_reader :http_body
    attr_reader :json_body
    attr_reader :http_headers

    def initialize(message=nil, http_status=nil, http_body=nil, json_body=nil,
                   http_headers=nil)
      @message = message
      @http_status = http_status
      @http_body = http_body
      @json_body = json_body
      @http_headers = http_headers || {}
    end

    def to_s
      status_string = @http_status.nil? ? "" : "(Status #{@http_status}) "
      "#{status_string}#{@message}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pingpp-2.2.4 lib/pingpp/errors/pingpp_error.rb
pingpp-2.2.3 lib/pingpp/errors/pingpp_error.rb
pingpp-2.2.2 lib/pingpp/errors/pingpp_error.rb
pingpp-2.2.1 lib/pingpp/errors/pingpp_error.rb
pingpp-2.2.0 lib/pingpp/errors/pingpp_error.rb
pingpp-2.1.3 lib/pingpp/errors/pingpp_error.rb
pingpp-2.1.1 lib/pingpp/errors/pingpp_error.rb
pingpp-2.1.0 lib/pingpp/errors/pingpp_error.rb