class RubyLLM::ConnectionError
Raised when a request never gets an answer from the provider or an MCP server: the connection is refused or drops, TLS fails, or the request times out. RubyLLM retries provider requests first, following Configuration#max_retries. The original Faraday error is its cause.
rescue RubyLLM::ConnectionError => e retry_later if e.timeout?
Public Instance Methods
Source
# File lib/ruby_llm/error.rb, line 351 def timeout? return true if cause.is_a?(Faraday::TimeoutError) cause.respond_to?(:wrapped_exception) && TIMEOUTS.any? { |timeout| cause.wrapped_exception.is_a?(timeout) } end
Returns whether the request timed out, including while opening the connection or waiting for the next bytes of a stream, rather than failing to connect.