From 8d0f38c44e896d7c5560cceb7215f5fb30930c49 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 28 Dec 2011 16:35:00 -0500 Subject: [PATCH] Revert "Hide exceptions if elasticsearch is not running. This needs some fixing and cleaning up by someone smarter than myself." This reverts commit eb1900265fb3f077cf104c0944d8832a8d48012e and fixes #45. --- Client.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Client.php b/Client.php index 2d7ea17..c868399 100644 --- a/Client.php +++ b/Client.php @@ -20,14 +20,7 @@ class Client extends Elastica_Client public function request($path, $method, $data = array()) { $start = microtime(true); - //this is ghetto, but i couldnt figure out another way of making our site continue to behave normally even if ES was not running. - //Any improvements on this welcome. Perhaps another parameter that allows you to control if you want to ignore exceptions about ES not running - try { - $response = parent::request($path, $method, $data); - } catch(\Exception $e) { - //again, ghetto, but couldnt figure out how to return a default empty Elastica_Response - return new \Elastica_Response('{"took":0,"timed_out":false,"hits":{"total":0,"max_score":0,"hits":[]}}'); - } + $response = parent::request($path, $method, $data); if (null !== $this->logger) { $time = microtime(true) - $start;