lib/httpx/errors.rb in httpx-0.20.5 vs lib/httpx/errors.rb in httpx-0.21.0

- old
+ new

@@ -22,9 +22,27 @@ class TotalTimeoutError < TimeoutError; end class ConnectTimeoutError < TimeoutError; end + class RequestTimeoutError < TimeoutError + attr_reader :request + + def initialize(request, response, timeout) + @request = request + @response = response + super(timeout, "Timed out after #{timeout} seconds") + end + + def marshal_dump + [message] + end + end + + class ReadTimeoutError < RequestTimeoutError; end + + class WriteTimeoutError < RequestTimeoutError; end + class SettingsTimeoutError < TimeoutError; end class ResolveTimeoutError < TimeoutError; end class ResolveError < Error; end