Method: CloudCheckr::API::ResponseError#initialize

Defined in:
lib/cloud_checkr/api/response_error.rb

#initialize(data) ⇒ ResponseError



5
6
7
8
9
10
11
12
# File 'lib/cloud_checkr/api/response_error.rb', line 5

def initialize(data)
  message       = data['Message']
  model_state   = data['ModelState']
  error_code    = model_state['ErrorCode'].join(', ')
  error_message = model_state['ErrorMessage'].join(', ')

  super("#{message} (#{error_code}: #{error_message})")
end