Exception: Ollama::Errors::SocketError

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

Overview

Ollama error class for handling socket errors when communicating with the Ollama API.

This exception is raised when a socket-level error occurs while attempting to connect to or communicate with the Ollama API. It inherits from Ollama::Errors::Error and provides specific handling for network-related issues that prevent successful API communication.

Examples:

Handling a socket error

begin
  ollama.generate(model: 'llama3.1', prompt: 'Hello World')
rescue Ollama::Errors::SocketError
  puts "Network connection failed"
end