Exception: Kameleoon::Exception::Initialization

Inherits:
KameleoonError
  • Object
show all
Defined in:
lib/kameleoon/exceptions.rb

Overview

SDK could not be initialized: its configuration failed to load or no initialization result was available within the requested timeout. The failure which prevented the initialization is available via cause; it is also reported in the message so a caller which only logs the message still learns why the SDK is not initialized.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site_code, environment, cause) ⇒ Initialization

Returns a new instance of Initialization.



82
83
84
85
86
# File 'lib/kameleoon/exceptions.rb', line 82

def initialize(site_code, environment, cause)
  @cause = cause
  super("SDK is not initialized for siteCode: '#{site_code}', environment: '#{environment}'. " \
        "Reason: #{cause.nil? ? 'unknown' : cause.message}")
end

Instance Attribute Details

#causeObject (readonly)

The failure which prevented the SDK from loading its configuration.



80
81
82
# File 'lib/kameleoon/exceptions.rb', line 80

def cause
  @cause
end