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

Merge pull request #2422 from maestrodev/google-notfound

[google] Raise Fog::Errors::NotFound on 404
This commit is contained in:
Nat Welch 2013-11-22 22:40:46 -08:00
commit 1c2ae5f527

View file

@ -73,9 +73,12 @@ module Fog
response.body = body
if response.body["error"]
response.status = response.body["error"]["code"]
response.body["error"]["errors"].each do |error|
raise Fog::Errors::Error.new(error["message"])
msg = response.body["error"]["errors"].map{|error| error["message"]}.join(", ")
case response.status
when 404
raise Fog::Errors::NotFound.new(msg)
else
raise Fog::Errors::Error.new(msg)
end
else
response.status = 200