Exception: HTTPX::TimeoutError

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

Overview

Error raised when there was a timeout. Its subclasses allow for finer-grained control of which timeout happened.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timeout, message) ⇒ TimeoutError

initializes the timeout exception with the timeout causing the error, and the error message for it.



19
20
21
22
# File 'lib/httpx/errors.rb', line 19

def initialize(timeout, message)
  @timeout = timeout
  super(message)
end

Instance Attribute Details

#timeoutObject (readonly)

The timeout value which caused this error to be raised.



15
16
17
# File 'lib/httpx/errors.rb', line 15

def timeout
  @timeout
end

Instance Method Details

#to_connection_errorObject

clones this error into a HTTPX::ConnectionTimeoutError.



25
26
27
28
29
# File 'lib/httpx/errors.rb', line 25

def to_connection_error
  ex = ConnectTimeoutError.new(@timeout, message)
  ex.set_backtrace(backtrace)
  ex
end