Exception: RubyPi::ProviderError

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

Overview

Raised when a provider-specific error occurs that does not map to one of the more specific error types. Includes the provider name for context.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, provider: nil) ⇒ ProviderError

Returns a new instance of ProviderError.

Parameters:

  • message (String) (defaults to: nil)

    human-readable error description

  • provider (Symbol, String) (defaults to: nil)

    provider identifier (e.g., :gemini, :anthropic)



83
84
85
86
# File 'lib/ruby_pi/errors.rb', line 83

def initialize(message = nil, provider: nil)
  @provider = provider
  super(message || "Provider error from #{provider}")
end

Instance Attribute Details

#providerSymbol, String (readonly)

Returns the name of the provider that raised the error.

Returns:

  • (Symbol, String)

    the name of the provider that raised the error



79
80
81
# File 'lib/ruby_pi/errors.rb', line 79

def provider
  @provider
end