Function: isTermChangedConcurrently()
@kortexya/reasoninglayer / isTermChangedConcurrently
Function: isTermChangedConcurrently()
Section titled “Function: isTermChangedConcurrently()”isTermChangedConcurrently(
error):error is ConstraintViolationError
Defined in: src/errors.ts:397
Whether error is the refusal of a write whose read premise another writer
broke before its commit (reasoninglayer#1263).
Parameters
Section titled “Parameters”unknown
Anything caught from an SDK call.
Returns
Section titled “Returns”error is ConstraintViolationError
true when error is a ConstraintViolationError whose
code is term_changed_concurrently; false otherwise.
Remarks
Section titled “Remarks”The body is the coded { error, code, message, refs }: refs.term names
the term the request read and another writer changed (read it with
errorBodyRefs). Nothing was written; read again and retry. Engine
d779b31031 answered the same conflict as an uncoded 409.
Example
Section titled “Example”try { await client.reviews.mergeEntity({ reviewId, targetTermId, conflictResolution: 'merge' });} catch (e) { if (isTermChangedConcurrently(e)) retryAfterReading();}