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 end
shared_directory 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 nil
end end
@ -42,7 +43,8 @@ module Fog
end end
shared_directory 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 nil
end end

View file

@ -47,7 +47,8 @@ module Fog
merge_attributes(data.headers) merge_attributes(data.headers)
self.content_length = Fog::Storage.get_body_size(body) self.content_length = Fog::Storage.get_body_size(body)
true 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 false
end end

View file

@ -19,7 +19,8 @@ module Fog
else else
nil nil
end 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 nil
end end
@ -32,7 +33,8 @@ module Fog
:key => key :key => key
}) })
new(file_data) 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 nil
end end
@ -45,7 +47,8 @@ module Fog
:key => key :key => key
}) })
new(file_data) 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 nil
end end