Exception: SmartlistSparkpost::DeliveryException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/smartlist_sparkpost/delivery_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ DeliveryException

Returns a new instance of DeliveryException.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/smartlist_sparkpost/delivery_exception.rb', line 5

def initialize(message)
  errors = [*message].first

  if errors.is_a?(Hash)
    @service_message     = errors['message']
    @service_description = errors['description']
    @service_code        = errors['code']
  end

  super(message)
end

Instance Attribute Details

#service_codeObject (readonly)

Returns the value of attribute service_code.



3
4
5
# File 'lib/smartlist_sparkpost/delivery_exception.rb', line 3

def service_code
  @service_code
end

#service_descriptionObject (readonly)

Returns the value of attribute service_description.



3
4
5
# File 'lib/smartlist_sparkpost/delivery_exception.rb', line 3

def service_description
  @service_description
end

#service_messageObject (readonly)

Returns the value of attribute service_message.



3
4
5
# File 'lib/smartlist_sparkpost/delivery_exception.rb', line 3

def service_message
  @service_message
end