lib/rbox/item.rb in rbox-0.1.0 vs lib/rbox/item.rb in rbox-0.1.1
- old
+ new
@@ -17,11 +17,18 @@
response = action(:get_file_info) do |req|
req.params.merge!(options)
req.params[:file_id] = file_id
end
- response_file = response.body['response']['info']
- response_file['id'] = response_file['file_id']
+ case response.body['response']['status']
+ when 's_get_file_info'
+ response_file = response.body['response']['info']
+ response_file['id'] = response_file['file_id']
+ when 'not_logged_in', 'e_access_denied'
+ raise Rbox::FileNotFoundError
+ when 'application_restricted'
+ raise Rbox::ApplicationRestricted
+ end
Response::File.new(response_file, self)
end
def public_share(target_id, target_type = 'file')
\ No newline at end of file