Exception: Clavis::ProviderNotConfigured
- Inherits:
-
ProviderError
- Object
- StandardError
- Error
- ProviderError
- Clavis::ProviderNotConfigured
- Defined in:
- lib/clavis/errors.rb
Instance Method Summary collapse
-
#initialize(provider_or_message) ⇒ ProviderNotConfigured
constructor
A new instance of ProviderNotConfigured.
Constructor Details
#initialize(provider_or_message) ⇒ ProviderNotConfigured
Returns a new instance of ProviderNotConfigured.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/clavis/errors.rb', line 38 def initialize() if .is_a?(String) && .include?("not configured") # Already a detailed message super else # Just a provider name, create a detailed message provider = .to_s = "Provider '#{provider}' is not properly configured. " \ "Please check your configuration in config/initializers/clavis.rb.\n" \ "Required fields for #{provider} provider: client_id, client_secret, and redirect_uri.\n" \ "Example configuration:\n" \ "Clavis.configure do |config|\n " \ "config.providers = {\n " \ "#{provider}: {\n " \ "client_id: 'your_client_id',\n " \ "client_secret: 'your_client_secret',\n " \ "redirect_uri: 'https://your-app.com/auth/#{provider}/callback'\n " \ "}\n " \ "}\n" \ "end" super() end end |