Exception: MessageMediaConversations::APIException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/message_media_conversations/exceptions/api_exception.rb

Overview

Class for exceptions when there is a network error, status code error, etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, context) ⇒ APIException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpContext)

    HttpContext of the API call.



12
13
14
15
16
# File 'lib/message_media_conversations/exceptions/api_exception.rb', line 12

def initialize(reason, context)
  super(reason)
  @context = context
  @response_code = context.response.status_code
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



7
8
9
# File 'lib/message_media_conversations/exceptions/api_exception.rb', line 7

def context
  @context
end

#response_codeObject (readonly)

Returns the value of attribute response_code.



7
8
9
# File 'lib/message_media_conversations/exceptions/api_exception.rb', line 7

def response_code
  @response_code
end