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

Allow the models to raise exception when there is insufficient access.

This commit is contained in:
Rupak Ganguly 2012-10-30 15:06:56 -04:00
parent ee2168a855
commit 64d319d40f
3 changed files with 12 additions and 6 deletions

View file

@ -23,7 +23,8 @@ module Fog
end
shared_directory
rescue Fog::Storage::HP::NotFound, Fog::HP::Errors::Forbidden
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
nil
end
@ -42,7 +43,8 @@ module Fog
end
shared_directory
rescue Fog::Storage::HP::NotFound, Fog::HP::Errors::Forbidden
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
nil
end

View file

@ -47,7 +47,8 @@ module Fog
merge_attributes(data.headers)
self.content_length = Fog::Storage.get_body_size(body)
true
rescue Fog::Storage::HP::NotFound, Fog::HP::Errors::Forbidden
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
false
end

View file

@ -19,7 +19,8 @@ module Fog
else
nil
end
rescue Fog::Storage::HP::NotFound, Fog::HP::Errors::Forbidden
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
nil
end
@ -32,7 +33,8 @@ module Fog
:key => key
})
new(file_data)
rescue Fog::Storage::HP::NotFound, Fog::HP::Errors::Forbidden
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
nil
end
@ -45,7 +47,8 @@ module Fog
:key => key
})
new(file_data)
rescue Fog::Storage::HP::NotFound, Fog::HP::Errors::Forbidden
# throws exception Fog::HP::Errors::Forbidden if insufficient access
rescue Fog::Storage::HP::NotFound
nil
end