lib/elasticsearch/api/actions/exists.rb in elasticsearch-api-1.0.9 vs lib/elasticsearch/api/actions/exists.rb in elasticsearch-api-1.0.10
- old
+ new
@@ -38,16 +38,12 @@
Utils.__escape(arguments[:id])
params = Utils.__validate_and_extract_params arguments, valid_params
body = nil
- perform_request(method, path, params, body).status == 200 ? true : false
- rescue Exception => e
- if e.class.to_s =~ /NotFound/ || e.message =~ /Not\s*Found|404/i
- false
- else
- raise e
- end
+ Utils.__rescue_from_not_found do
+ perform_request(method, path, params, body).status == 200 ? true : false
+ end
end
alias_method :exists?, :exists
end
end