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