Exception: HTTPX::RequestTimeoutError

Inherits:
TimeoutError show all
Defined in:
lib/httpx/errors.rb,
sig/errors.rbs

Overview

Error raised when there was a timeout while sending a request, or receiving a response from the server.

Instance Attribute Summary collapse

Attributes inherited from TimeoutError

#timeout

Instance Method Summary collapse

Methods inherited from TimeoutError

#to_connection_error

Constructor Details

#initialize(request, response, timeout) ⇒ RequestTimeoutError

initializes the exception with the request and response it refers to, and the timeout causing the error, and the

Parameters:

  • request (Request)
  • response (Object)
  • timeout (interval)


51
52
53
54
55
# File 'lib/httpx/errors.rb', line 51

def initialize(request, response, timeout)
  @request = request
  @response = response
  super(timeout, "Timed out after #{timeout} seconds")
end

Instance Attribute Details

#requestRequest (readonly)

The HTTPX::Request request object this exception refers to.

Returns:



44
45
46
# File 'lib/httpx/errors.rb', line 44

def request
  @request
end

#responseObject (readonly)

The response object this exception refers to.

Returns:

  • (Object)


47
48
49
# File 'lib/httpx/errors.rb', line 47

def response
  @response
end

Instance Method Details

#marshal_dumpObject



57
58
59
# File 'lib/httpx/errors.rb', line 57

def marshal_dump
  [message]
end