From: Christian Weiske Date: Wed, 5 Nov 2014 10:51:21 +0000 (+0100) Subject: show url and HTTP method in exception X-Git-Tag: v0.5.0~17 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/fc9ddff30bafd071990dfb95c9a8520b457da2e9?hp=abf08ecdb046202de8b5abf0392b4b76a5d0f89a show url and HTTP method in exception --- 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 ); }