Exception: MdnQuery::HttpRequestFailed

Inherits:
Error
  • Object
show all
Defined in:
lib/mdn_query/errors.rb

Overview

The error for failed HTTP request of any kind.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, error) ⇒ MdnQuery::HttpRequestFailed

Creates a new HttpRequestFailed error.

Parameters:

  • url (String)

    the URL of the request

  • error (SocketError, RestClient::Exception)

    the original error



37
38
39
40
# File 'lib/mdn_query/errors.rb', line 37

def initialize(url, error)
  @url = url
  @http_error = error
end

Instance Attribute Details

#http_errorSocketError, RestClient::Exception (readonly)

Returns the original error.

Returns:

  • (SocketError, RestClient::Exception)

    the original error



30
31
32
# File 'lib/mdn_query/errors.rb', line 30

def http_error
  @http_error
end

#urlString (readonly)

Returns the URL of the request.

Returns:

  • (String)

    the URL of the request



27
28
29
# File 'lib/mdn_query/errors.rb', line 27

def url
  @url
end