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:
commit
1c2ae5f527
1 changed files with 6 additions and 3 deletions
|
@ -73,9 +73,12 @@ module Fog
|
||||||
response.body = body
|
response.body = body
|
||||||
if response.body["error"]
|
if response.body["error"]
|
||||||
response.status = response.body["error"]["code"]
|
response.status = response.body["error"]["code"]
|
||||||
|
msg = response.body["error"]["errors"].map{|error| error["message"]}.join(", ")
|
||||||
response.body["error"]["errors"].each do |error|
|
case response.status
|
||||||
raise Fog::Errors::Error.new(error["message"])
|
when 404
|
||||||
|
raise Fog::Errors::NotFound.new(msg)
|
||||||
|
else
|
||||||
|
raise Fog::Errors::Error.new(msg)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
response.status = 200
|
response.status = 200
|
||||||
|
|
Loading…
Reference in a new issue