Exception: CreateSend::CreateSendError
- Inherits:
-
StandardError
- Object
- StandardError
- CreateSend::CreateSendError
- Defined in:
- lib/createsend/createsend.rb
Overview
Represents a CreateSend API error. Contains specific data about the error.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ CreateSendError
constructor
A new instance of CreateSendError.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
13 14 15 |
# File 'lib/createsend/createsend.rb', line 13 def data @data end |