Class: Verizon::EdgePerformanceResultException

Inherits:
APIException
  • Object
show all
Defined in:
lib/verizon/exceptions/edge_performance_result_exception.rb

Overview

Types of errors in response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ EdgePerformanceResultException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpResponse)

    HttpReponse of the API call.



23
24
25
26
27
# File 'lib/verizon/exceptions/edge_performance_result_exception.rb', line 23

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

Instance Attribute Details

#messageString

Error details.

Returns:

  • (String)


18
19
20
# File 'lib/verizon/exceptions/edge_performance_result_exception.rb', line 18

def message
  @message
end

#statusString

HTTP status code.

Returns:

  • (String)


14
15
16
# File 'lib/verizon/exceptions/edge_performance_result_exception.rb', line 14

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



32
33
34
35
# File 'lib/verizon/exceptions/edge_performance_result_exception.rb', line 32

def unbox(hash)
  @status = hash.key?('status') ? hash['status'] : SKIP
  @message = hash.key?('message') ? hash['message'] : SKIP
end