From fc9ddff30bafd071990dfb95c9a8520b457da2e9 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 5 Nov 2014 11:51:21 +0100 Subject: [PATCH] show url and HTTP method in exception --- src/phorkie/Database/Adapter/Elasticsearch/HTTPRequest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/phorkie/Database/Adapter/Elasticsearch/HTTPRequest.php b/src/phorkie/Database/Adapter/Elasticsearch/HTTPRequest.php index 4cc02d6..24487bc 100644 --- a/src/phorkie/Database/Adapter/Elasticsearch/HTTPRequest.php +++ b/src/phorkie/Database/Adapter/Elasticsearch/HTTPRequest.php @@ -22,9 +22,11 @@ class Database_Adapter_Elasticsearch_HTTPRequest extends \HTTP_Request2 } else { $error = $res->getBody(); } + throw new Exception( - 'Error in elasticsearch communication' - . '(status code ' . $res->getStatus() . '): ' + 'Error in elasticsearch communication at ' + . $this->getMethod() . ' ' . (string) $this->getUrl() + . ' (status code ' . $res->getStatus() . '): ' . $error ); } -- 2.30.2