1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

trying to actually handle response error data.

This commit is contained in:
Nat Welch 2013-06-20 16:29:29 -07:00
parent b4c5766c69
commit b55857f3db
2 changed files with 7 additions and 1 deletions

View file

@ -124,6 +124,11 @@ module Fog
response.body = Fog::JSON.decode(result.body)
if response.body["error"]
response.status = response.body["error"]["code"]
response.body["error"]["errors"].each do |error|
# We could throw these I guess.
p Fog::Errors::Error.new(error)
end
else
response.status = 200
end

View file

@ -44,7 +44,6 @@ module Fog
def ready?
data = service.get_server(self.name, self.zone_name).body
p data
data['zone_name'] = self.zone_name
self.merge_attributes(data)
@ -67,6 +66,8 @@ module Fog
zone_name,
machine_type)
p data
data = service.get_server(self.name, self.zone_name).body
service.servers.merge_attributes(data)
end