From 80f7dc77d430774192b929d780f96260066df2ee Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 18 Oct 2015 09:31:31 +0200 Subject: Update to MediaWiki 1.25.3 --- .../Elastica/Exception/ElasticsearchException.php | 99 ---------------------- 1 file changed, 99 deletions(-) delete mode 100644 vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php (limited to 'vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php') diff --git a/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php b/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php deleted file mode 100644 index 0f7509f9..00000000 --- a/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php +++ /dev/null @@ -1,99 +0,0 @@ - - */ -class ElasticsearchException extends \Exception -{ - - const REMOTE_TRANSPORT_EXCEPTION = 'RemoteTransportException'; - - /** - * Elasticsearch exception name - * - * @var string|null - */ - private $_exception; - - /** - * Whether exception was local to server node or remote - * - * @var bool - */ - private $_isRemote = false; - - /** - * Constructs elasticsearch exception - * - * @param int $code Error code - * @param string $error Error message from elasticsearch - */ - public function __construct($code, $error) - { - $this->_parseError($error); - parent::__construct($error, $code); - } - - /** - * Parse error message from elasticsearch - * - * @param string $error Error message - */ - protected function _parseError($error) - { - $errors = explode(']; nested: ', $error); - - if (count($errors) == 1) { - $this->_exception = $this->_extractException($errors[0]); - } else { - if ($this->_extractException($errors[0]) == self::REMOTE_TRANSPORT_EXCEPTION) { - $this->_isRemote = true; - $this->_exception = $this->_extractException($errors[1]); - } else { - $this->_exception = $this->_extractException($errors[0]); - } - } - } - - /** - * Extract exception name from error response - * - * @param string $error - * @return null|string - */ - protected function _extractException($error) - { - if (preg_match('/^(\w+)\[.*\]/', $error, $matches)) { - return $matches[1]; - } else { - return null; - } - } - - /** - * Returns elasticsearch exception name - * - * @return string|null - */ - public function getExceptionName() - { - return $this->_exception; - } - - /** - * Returns whether exception was local to server node or remote - * - * @return bool - */ - public function isRemoteTransportException() - { - return $this->_isRemote; - } - -} -- cgit v1.2.3-54-g00ecf