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:
parent
9fe17c5978
commit
8a1d31506f
1 changed files with 9 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue