lib/manageiq/api/client/connection.rb in manageiq-api-client-0.3.1 vs lib/manageiq/api/client/connection.rb in manageiq-api-client-0.3.2
- old
+ new
@@ -101,10 +101,13 @@
end
check_response
end
def check_response
- if response.status >= 400
+ if response.status == 404
+ message = json_response.fetch_path("error", "message") || json_response["error"]
+ raise ManageIQ::API::Client::ResourceNotFound, message
+ elsif response.status >= 400
@error = ManageIQ::API::Client::Error.new(response.status, json_response)
raise @error.message
end
end
end