class Bandwidth::ErrorWithRequestException
ErrorWithRequest class.
Attributes
error[RW]
An error message pertaining to what the issue could be @return [String]
request_id[RW]
The associated requestId from AWS @return [String]
Public Class Methods
new(reason, response)
click to toggle source
The constructor. @param [String] The reason for raising an exception. @param [HttpResponse] The HttpReponse of the API call.
Calls superclass method
Bandwidth::APIException::new
# File lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb, line 20 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end
Public Instance Methods
unbox(hash)
click to toggle source
Populates this object by extracting properties from a hash. @param [Hash] The deserialized response sent by the server in the response body.
# File lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb, line 29 def unbox(hash) @error = hash['error'] @request_id = hash['requestId'] end