Documentation of StatusCode
Fri, 03/23/2012 - 18:02
Hi there,
using C# Couchbase client; the CasResult method exposes an property "StatusCode". Is there any documentation about the meaning of these integer values?
I found in the documentation that there are some states like "LOCK_ERROR" or "EXISTS". Do you know where i ll find a list of integers and their correspondending meanings?
var CasResult = await dbclient.CasAsync<string>(Enyim.Caching.Memcached.StoreMode.Set,
document.GetId(), document.ToJSON(), cas);
CasResult.StatusCode // <--- ?? I plan to use StatusCode to inform the caller... i.e. "operation abort, cause newer version exists.." or "network error, request queued up for retry..."
Thanks for your reply in advance.
Tom
Issue closed.
Hi,
if someone is interessted in the status codes.. here there are..
found at binary protocol specification of memchached:
http://code.google.com/p/memcached/wiki/BinaryProtocolRevamped#Response_...
Response Status
Possible values of this two-byte field:
0x0000 No error
0x0001 Key not found
0x0002 Key exists
0x0003 Value too large
0x0004 Invalid arguments
0x0005 Item not stored
0x0006 Incr/Decr on non-numeric value.
0x0007 The vbucket belongs to another server
0x0008 Authentication error
0x0009 Authentication continue
0x0081 Unknown command
0x0082 Out of memory
0x0083 Not supported
0x0084 Internal error
0x0085 Busy
0x0086 Temporary failure
I saw in the DotNet client implementation, that the api handels 0x0007 itself. For now, i think a retry-logic for an failed operation is only nessesairy in few cases (StatusCode = 85, 84, 86) and maybe for 9? Can somebody of the couchbase team commit that?
Last question here.. some CouchbaseClient methods does not return any status information directly. f.e. "CouchbaseClient.Get". Is there an aditional api call to get the latest status code or message (this might be a bit dangerous in an asynchron world)? Or would you recommend to use only the cas-versions of Get/Store?
Thanks and happy coding!
Tom