Skip to content

Commit

Permalink
Returning the HTTP body with the exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
massung committed Jan 5, 2012
1 parent 621ee72 commit cdf358f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions riak.php
Expand Up @@ -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"]);
Expand Down

0 comments on commit cdf358f

Please sign in to comment.