lib/elasticsearch/api/actions/ping.rb in elasticsearch-api-1.0.17 vs lib/elasticsearch/api/actions/ping.rb in elasticsearch-api-1.0.18
- old
+ new
@@ -14,11 +14,17 @@
method = HTTP_HEAD
path = ""
params = {}
body = nil
- Utils.__rescue_from_not_found do
+ begin
perform_request(method, path, params, body).status == 200 ? true : false
+ rescue Exception => e
+ if e.class.to_s =~ /NotFound|ConnectionFailed/ || e.message =~ /Not\s*Found|404|ConnectionFailed/i
+ false
+ else
+ raise e
+ end
end
end
end
end
end