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) response.body = Fog::JSON.decode(result.body)
if response.body["error"] if response.body["error"]
response.status = response.body["error"]["code"] 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 else
response.status = 200 response.status = 200
end end

View file

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