Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- /** @noinspection PhpUnusedLocalVariableInspection */
- $this->client = new ElasticSearchClient($params);
- $ping = $this->client->ping();
- if ($ping) {
- $this->addDebug('Consumer ES Action connect response : CONNECTED');
- } else {
- $this->addError('Consumer ES Action connect response : CONNECTION FAILED');
- throw new \Exception();
- }
- return $ping;
- } catch (\Exception $e) {
- $this->addError('Consumer ES Action connect exception : ' . print_r($e->getMessage(), 1));
- throw new \Exception('Error connecting to Elasticsearch : ' . json_encode($params));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement