lib/elasticsearch/api/actions/indices/exists.rb in elasticsearch-api-1.0.9 vs lib/elasticsearch/api/actions/indices/exists.rb in elasticsearch-api-1.0.10

- old
+ new

@@ -40,15 +40,11 @@ method = HTTP_HEAD path = Utils.__listify(arguments[:index]) 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 + Utils.__rescue_from_not_found do + perform_request(method, path, params, body).status == 200 ? true : false end end alias_method :exists?, :exists end