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)
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue