Exception: HTTPX::TimeoutError
- 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.
Direct Known Subclasses
ConnectTimeoutError, PoolTimeoutError, RequestTimeoutError, ResolveTimeoutError, SettingsTimeoutError
Instance Attribute Summary collapse
-
#timeout ⇒ Object
readonly
The timeout value which caused this error to be raised.
Instance Method Summary collapse
-
#initialize(timeout, message) ⇒ TimeoutError
constructor
initializes the timeout exception with the
timeout
causing the error, and the errormessage
for it. -
#to_connection_error ⇒ Object
clones this error into a HTTPX::ConnectionTimeoutError.
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, ) @timeout = timeout super() end |
Instance Attribute Details
#timeout ⇒ Object (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_error ⇒ Object
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, ) ex.set_backtrace(backtrace) ex end |