Skip to content

Commit ef78b85

Browse files
committed
NCBC-4055 Correct Stellar exception when locked/unlocked
Motivation ========== Make the sdk and stellar api match - both should throw the same exception when discovering a document is locked, or trying to unlock a locked doc. Modification ============= No more DocumentLockedException when stellar discovers an error with the matching retry string, instead an UnambiguousTimeoutException is thrown, to match the existing api behavior. Results ======= Touch/Unlock/DocNotLocked tests all pass both with stellar and the regular api. Change-Id: I79ad48999235de5bb2086d45e8191a4c24cd74ee Reviewed-on: https://review.couchbase.org/c/couchbase-net-client/+/234470 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Michael Reiche <michael.reiche@couchbase.com>
1 parent 1d2f26a commit ef78b85

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Couchbase/Stellar/Core/Retry/StellarRetryHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private void HandleException(RpcException protoException, IRequest request, Gene
152152
case StellarRetryStrings.PreconditionLocked:
153153
{
154154
context.RetryReasons.Add(RetryReason.KvLocked);
155-
throw new DocumentLockedException(context);
155+
throw new UnambiguousTimeoutException("Document is locked", context);
156156
}
157157
case StellarRetryStrings.Unlocked:
158158
throw new DocumentNotLockedException();

0 commit comments

Comments
 (0)