class HTTPX::TimeoutError

  1. lib/httpx/errors.rb
Superclass: Error

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

Methods

Public Class

  1. new

Public Instance

  1. timeout
  2. to_connection_error

Attributes

timeout [R]

The timeout value which caused this error to be raised.

Public Class methods

new(timeout, message)

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

[show source]
   # File lib/httpx/errors.rb
19 def initialize(timeout, message)
20   @timeout = timeout
21   super(message)
22 end

Public Instance methods

to_connection_error()

clones this error into a HTTPX::ConnectionTimeoutError.

[show source]
   # File lib/httpx/errors.rb
25 def to_connection_error
26   ex = ConnectTimeoutError.new(@timeout, message)
27   ex.set_backtrace(backtrace)
28   ex
29 end