Exception: Postal::SendError

Inherits:
Error
  • Object
show all
Defined in:
lib/postal/error.rb

Overview

Raised when a message cannot be found by its ID

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, error_message) ⇒ SendError

Returns a new instance of SendError.



30
31
32
33
# File 'lib/postal/error.rb', line 30

def initialize(code, error_message)
  @code = code
  @error_message = error_message
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



35
36
37
# File 'lib/postal/error.rb', line 35

def code
  @code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



36
37
38
# File 'lib/postal/error.rb', line 36

def error_message
  @error_message
end

Instance Method Details

#messageObject



38
39
40
# File 'lib/postal/error.rb', line 38

def message
  "[#{@code}] #{@error_message}"
end

#to_sObject



42
43
44
# File 'lib/postal/error.rb', line 42

def to_s
  message
end