Exception: Soka::Rails::MissingApiKeyError
- Inherits:
-
ConfigurationError
- Object
- StandardError
- Error
- ConfigurationError
- Soka::Rails::MissingApiKeyError
- Defined in:
- lib/soka/rails/errors.rb
Overview
Specific error classes Raised when API key is missing for the configured provider
Instance Method Summary collapse
-
#initialize(provider = nil) ⇒ MissingApiKeyError
constructor
A new instance of MissingApiKeyError.
Constructor Details
#initialize(provider = nil) ⇒ MissingApiKeyError
Returns a new instance of MissingApiKeyError.
27 28 29 30 31 32 33 34 35 |
# File 'lib/soka/rails/errors.rb', line 27 def initialize(provider = nil) = if provider "Missing API key for provider: #{provider}. " \ "Please set SOKA_API_KEY or SOKA_#{provider.to_s.upcase}_API_KEY environment variable." else 'Missing API key. Please set SOKA_API_KEY environment variable.' end super() end |