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:



48
49
50
51
52
# File 'lib/httpx/errors.rb', line 48

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

#responseresponse? (readonly)

Returns the value of attribute response.

Returns:



34
35
36
# File 'sig/errors.rbs', line 34

def response
  @response
end

Instance Method Details

#marshal_dumpObject



54
55
56
# File 'lib/httpx/errors.rb', line 54

def marshal_dump
  [message]
end