lib/manageiq/api/client/error.rb in manageiq-api-client-0.1.1 vs lib/manageiq/api/client/error.rb in manageiq-api-client-0.2.0
- old
+ new
@@ -16,12 +16,16 @@
end
def update(status, json_response = {})
@status = status
@kind, @message, @klass = nil
- error_hash = json_response["error"]
- if status >= 400 && error_hash.present?
- @kind, @message, @klass = error_hash.values_at("kind", "message", "klass")
+ 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
end
end
end