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:
parent
b4c5766c69
commit
b55857f3db
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue