Permalink
Browse files

SPY-90: getStats() can return an error

Change-Id: Ida7f9ec4aa101873d464a42db9e5b2b55f2910fa
Reviewed-on: http://review.couchbase.org/17028
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
  • Loading branch information...
mikewied committed Jun 11, 2012
1 parent cead32e commit 40f700f7ed4e4530cac831b30fd5bba68236cc0b
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/net/spy/memcached/protocol/binary/StatsOperationImpl.java
@@ -25,6 +25,7 @@
import java.io.IOException;
import net.spy.memcached.ops.OperationState;
+import net.spy.memcached.ops.OperationStatus;
import net.spy.memcached.ops.StatsOperation;
/**
@@ -56,7 +57,8 @@ protected void finishedPayload(byte[] pl) throws IOException {
Callback cb = (Callback) getCallback();
cb.gotStat(new String(keyBytes, "UTF-8"), new String(data, "UTF-8"));
} else {
- getCallback().receivedStatus(STATUS_OK);
+ OperationStatus status = getStatusForErrorCode(errorCode, pl);
+ getCallback().receivedStatus(status);
transitionState(OperationState.COMPLETE);
}
resetInput();

0 comments on commit 40f700f

Please sign in to comment.