IMemcachedClient.Cas StatusCode -1
I'm trying to modify Couchbase.AspNet.CouchbaseSessionStateProvider to throw an exception if it cannot write to the backing Couchbase bucket (right now it silently buries the error, making it difficult to debug or give meaningful error messages). I know IMemcachedClient.Save will return false if it's unable to write, but the CasResult return value from IMemcachedClient.Cas is rather magic-numberey. From what I've been able to grok, it should return a CasResult with a StatusCode of -1 if it's completely unable to execute the actual check and set operation (the bucket doesn't exist or Couchbase server is down). Is this a correct interpretation?
Thanks,
Peter
Thanks, I'll be able to work with that.
Unfortunately IMemcachedClient doesn't contain the "Execute*" methods, so I'm stuck using StatusCode == -1 as my condition, correct?
There is another interface - IMemcachedResultsClient - which contains the Execute methods. MemcachedClient implements both of them.
Hi Peter,
Though the Operation Results API still swallows exceptions, it does wrap them up and allow you to inspect them. See http://www.couchbase.com/wiki/display/couchbase/Couchbase+.NET+Client+Li... for more information.
Please note, I'm working through a couple of improvements that will ensure that the right status codes are bubbling up to the top.
-- jz