class ManageIQ::API::Client::Error

Attributes

kind[R]
klass[R]
message[R]
status[R]

Public Class Methods

new(status = 0, json_response = {}) click to toggle source
# File lib/manageiq/api/client/error.rb, line 10
def initialize(status = 0, json_response = {})
  update(status, json_response)
end

Public Instance Methods

clear() click to toggle source
# File lib/manageiq/api/client/error.rb, line 14
def clear
  update(0)
end
update(status, json_response = {}) click to toggle source
# File lib/manageiq/api/client/error.rb, line 18
def update(status, json_response = {})
  @status = status
  @kind, @message, @klass = nil
  error = json_response["error"]
  if status >= 400 && error.present?
    if error.kind_of?(Hash)
      @kind, @message, @klass = error.values_at("kind", "message", "klass")
    else
      @message = error
    end
  end
end