Exception: SuggestGrid::LimitExceededErrorResponse

Inherits:
APIException
  • Object
show all
Defined in:
lib/suggestgrid/exceptions/limit_exceeded_error_response.rb

Overview

Error response.

Instance Attribute Summary collapse

Attributes inherited from APIException

#context, #response_code

Instance Method Summary collapse

Constructor Details

#initialize(reason, context) ⇒ LimitExceededErrorResponse

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpContext)

    HttpContext of the API call.



30
31
32
33
34
# File 'lib/suggestgrid/exceptions/limit_exceeded_error_response.rb', line 30

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

Instance Attribute Details

#error_descriptionString

Description of the response.

Returns:



13
14
15
# File 'lib/suggestgrid/exceptions/limit_exceeded_error_response.rb', line 13

def error_description
  @error_description
end

#error_textString

Message of the response.

Returns:



9
10
11
# File 'lib/suggestgrid/exceptions/limit_exceeded_error_response.rb', line 9

def error_text
  @error_text
end

#error_uriString

The URI of the error for more details.

Returns:



17
18
19
# File 'lib/suggestgrid/exceptions/limit_exceeded_error_response.rb', line 17

def error_uri
  @error_uri
end

#limitLong

The limit quantity of the account.

Returns:

  • (Long)


25
26
27
# File 'lib/suggestgrid/exceptions/limit_exceeded_error_response.rb', line 25

def limit
  @limit
end

#usedLong

The quantity used by the account.

Returns:

  • (Long)


21
22
23
# File 'lib/suggestgrid/exceptions/limit_exceeded_error_response.rb', line 21

def used
  @used
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



39
40
41
42
43
44
45
# File 'lib/suggestgrid/exceptions/limit_exceeded_error_response.rb', line 39

def unbox(hash)
  @error_text = hash['error_text']
  @error_description = hash['error_description']
  @error_uri = hash['error_uri']
  @used = hash['used']
  @limit = hash['limit']
end