Exception: CreateSend::CreateSendError

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

Overview

Represents a CreateSend API error. Contains specific data about the error.

Direct Known Subclasses

BadRequest, Unauthorized

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ CreateSendError

Returns a new instance of CreateSendError.



14
15
16
17
18
19
20
# File 'lib/createsend/createsend.rb', line 14

def initialize(data)
  @data = data
  # @data should contain Code, Message and optionally ResultData
  extra = @data.ResultData ? "\nExtra result data: #{@data.ResultData}" : ""
  super "The CreateSend API responded with the following error"\
    " - #{@data.Code}: #{@data.Message}#{extra}"
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



13
14
15
# File 'lib/createsend/createsend.rb', line 13

def data
  @data
end