Exception: MessageMediaMessages::SendMessages400ResponseException

Inherits:
APIException
  • Object
show all
Defined in:
lib/message_media_messages/exceptions/send_messages400_response_exception.rb

Overview

Send messages 400 response class.

Instance Attribute Summary collapse

Attributes inherited from APIException

#context, #response_code

Instance Method Summary collapse

Constructor Details

#initialize(reason, context) ⇒ SendMessages400ResponseException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpContext)

    HttpContext of the API call.



16
17
18
19
20
# File 'lib/message_media_messages/exceptions/send_messages400_response_exception.rb', line 16

def initialize(reason, context)
  super(reason, context)
  hash = APIHelper.json_deserialize(@context.response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#messageString

TODO: Write general description for this method

Returns:



11
12
13
# File 'lib/message_media_messages/exceptions/send_messages400_response_exception.rb', line 11

def message
  @message
end

Instance Method Details

#unbox(hash) ⇒ Object

Populates this object by extracting properties from a hash. response body.

Parameters:

  • The (Hash)

    deserialized response sent by the server in the



25
26
27
# File 'lib/message_media_messages/exceptions/send_messages400_response_exception.rb', line 25

def unbox(hash)
  @message = hash['message']
end