basho/riak-php-client

PHP Client riak.php does not recognize 204 response code and report error [JIRA: CLIENTS-85]

Closed this issue · 7 comments

In riak.php line 1058, it only recognize 200 and 300 code.
# Run the operation.
$response = RiakUtils::httpRequest('PUT', $url, $headers, $content);
$this->populate($response, array(200, 300));
return $this;
However, the latest Riak can return 204 for empty response body, then the client throws an error from populate(..). The fix is simple:
$this->populate($response, array(200, 201, 204, ...., 300, 303, 304, ....));
And there are other similar issues in the client code.

Alright. The best way to fix this would be to create a new failing test, implement a fix and submit both as a pull request from a feature branch in your fork. Short of that, you might just create a failing test and throw it into a gist and add the link here.

What operation were you attempting to perform when the error presented itself?

What other similar issues are you referring to?

Daniel, if this issue still occurs for you, can you give us solid examples of usage and failures? (reproducible examples, that is)

Hey intel, I don't use it any more, I have migrated to other noSQL solutions. But I guess the problem is still there.

I ended up addressing this in my own client, your report made me look into
it further in my own code, thanks :-)

I've moved on to mongodb personally, but still maintaining my client for
others.

Cheers
On Mar 18, 2012 10:13 PM, "Daniel Wu" <
reply@reply.github.com>
wrote:

Hey intel, I don't use it any more, I have migrated to other noSQL
solutions. But I guess the problem is still there.


Reply to this email directly or view it on GitHub:
#11 (comment)

I added code to the 1.4.x branch to handle for this. aecae05

I will also transfer this change to the 2.x rewrite branch.

Chris -

Guess we can resolve this one, too?

_[posted via JIRA by Brett Hazen]_