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
|
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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue