summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php b/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php
index 63244487..57502307 100644
--- a/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php
+++ b/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php
@@ -1,37 +1,30 @@
<?php
-
namespace Elastica\Exception;
use Elastica\Request;
use Elastica\Response;
/**
- * Response exception
+ * Response exception.
*
- * @category Xodoa
- * @package Elastica
* @author Nicolas Ruflin <spam@ruflin.com>
*/
class ResponseException extends \RuntimeException implements ExceptionInterface
{
/**
- * Request
- *
* @var \Elastica\Request Request object
*/
protected $_request = null;
/**
- * Response
- *
* @var \Elastica\Response Response object
*/
protected $_response = null;
/**
- * Construct Exception
+ * Construct Exception.
*
- * @param \Elastica\Request $request
+ * @param \Elastica\Request $request
* @param \Elastica\Response $response
*/
public function __construct(Request $request, Response $response)
@@ -42,7 +35,7 @@ class ResponseException extends \RuntimeException implements ExceptionInterface
}
/**
- * Returns request object
+ * Returns request object.
*
* @return \Elastica\Request Request object
*/
@@ -52,7 +45,7 @@ class ResponseException extends \RuntimeException implements ExceptionInterface
}
/**
- * Returns response object
+ * Returns response object.
*
* @return \Elastica\Response Response object
*/
@@ -62,14 +55,15 @@ class ResponseException extends \RuntimeException implements ExceptionInterface
}
/**
- * Returns elasticsearch exception
+ * Returns elasticsearch exception.
*
* @return ElasticsearchException
*/
- public function getElasticsearchException() {
+ public function getElasticsearchException()
+ {
$response = $this->getResponse();
$transfer = $response->getTransferInfo();
- $code = array_key_exists('http_code', $transfer) ? $transfer['http_code'] : 0;
+ $code = array_key_exists('http_code', $transfer) ? $transfer['http_code'] : 0;
return new ElasticsearchException($code, $response->getError());
}