Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. try {
  2. /** @noinspection PhpUnusedLocalVariableInspection */
  3. $this->client = new ElasticSearchClient($params);
  4. $ping = $this->client->ping();
  5. if ($ping) {
  6. $this->addDebug('Consumer ES Action connect response : CONNECTED');
  7. } else {
  8. $this->addError('Consumer ES Action connect response : CONNECTION FAILED');
  9. throw new \Exception();
  10. }
  11. return $ping;
  12. } catch (\Exception $e) {
  13. $this->addError('Consumer ES Action connect exception : ' . print_r($e->getMessage(), 1));
  14. throw new \Exception('Error connecting to Elasticsearch : ' . json_encode($params));
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement