summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php32
1 files changed, 12 insertions, 20 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php b/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php
index 0f7509f9..59cca0c6 100644
--- a/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php
+++ b/vendor/ruflin/elastica/lib/Elastica/Exception/ElasticsearchException.php
@@ -1,37 +1,29 @@
<?php
-
namespace Elastica\Exception;
/**
- * Elasticsearch exception
+ * Elasticsearch exception.
*
- * @category Xodoa
- * @package Elastica
* @author Ian Babrou <ibobrik@gmail.com>
*/
-class ElasticsearchException extends \Exception
+class ElasticsearchException extends \Exception implements ExceptionInterface
{
-
const REMOTE_TRANSPORT_EXCEPTION = 'RemoteTransportException';
/**
- * Elasticsearch exception name
- *
- * @var string|null
+ * @var string|null Elasticsearch exception name
*/
private $_exception;
/**
- * Whether exception was local to server node or remote
- *
- * @var bool
+ * @var bool Whether exception was local to server node or remote
*/
private $_isRemote = false;
/**
- * Constructs elasticsearch exception
+ * Constructs elasticsearch exception.
*
- * @param int $code Error code
+ * @param int $code Error code
* @param string $error Error message from elasticsearch
*/
public function __construct($code, $error)
@@ -41,7 +33,7 @@ class ElasticsearchException extends \Exception
}
/**
- * Parse error message from elasticsearch
+ * Parse error message from elasticsearch.
*
* @param string $error Error message
*/
@@ -62,9 +54,10 @@ class ElasticsearchException extends \Exception
}
/**
- * Extract exception name from error response
+ * Extract exception name from error response.
*
* @param string $error
+ *
* @return null|string
*/
protected function _extractException($error)
@@ -72,12 +65,12 @@ class ElasticsearchException extends \Exception
if (preg_match('/^(\w+)\[.*\]/', $error, $matches)) {
return $matches[1];
} else {
- return null;
+ return;
}
}
/**
- * Returns elasticsearch exception name
+ * Returns elasticsearch exception name.
*
* @return string|null
*/
@@ -87,7 +80,7 @@ class ElasticsearchException extends \Exception
}
/**
- * Returns whether exception was local to server node or remote
+ * Returns whether exception was local to server node or remote.
*
* @return bool
*/
@@ -95,5 +88,4 @@ class ElasticsearchException extends \Exception
{
return $this->_isRemote;
}
-
}