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:
parent
ee2168a855
commit
64d319d40f
3 changed files with 12 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue