From cdf358f160832538714c5f90e47fcb2f59e7903c Mon Sep 17 00:00:00 2001 From: Jeffrey Massung Date: Thu, 5 Jan 2012 14:48:46 -0700 Subject: [PATCH] Returning the HTTP body with the exception. --- riak.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/riak.php b/riak.php index 884a3e9..a41eba5 100644 --- a/riak.php +++ b/riak.php @@ -987,13 +987,12 @@ function getKeys() { */ function indexSearch($indexName, $indexType, $startOrExact, $end=NULL, $dedupe=false) { $url = RiakUtils::buildIndexPath($this->client, $this, "{$indexName}_{$indexType}", $startOrExact, $end, NULL); - $response = RiakUtils::httpRequest('GET', $url); + list ($response,$body) = RiakUtils::httpRequest('GET', $url); $obj = new RiakObject($this->client, $this, NULL); $obj->populate($response, array(200)); - echo $response; if (!$obj->exists()) { - throw Exception("Error searching index."); + throw Exception("Error searching index: " . $body); } $data = $obj->getData(); $keys = array_map("urldecode",$data["keys"]);