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

[aws|storage] discern between no file and no directory for files.get

closes #160
This commit is contained in:
geemus 2011-05-27 11:07:31 -07:00
parent 9fe17c5978
commit 8a1d31506f

View file

@ -65,8 +65,15 @@ module Fog
})
normalise_headers(file_data)
new(file_data)
rescue Excon::Errors::NotFound
nil
rescue Excon::Errors::NotFound => error
case error.message
when /<Code>NoSuchKey<\/Code>/
nil
when /<Code>NoSuchBucket<\/Code>/
raise(Fog::AWS::DNS::NotFound.new("Directory #{directory.identity} does not exist."))
else
raise(error)
end
end
def get_url(key, expires)