Function: isDependantChangedConcurrently()
@kortexya/reasoninglayer / isDependantChangedConcurrently
Function: isDependantChangedConcurrently()
Section titled “Function: isDependantChangedConcurrently()”isDependantChangedConcurrently(
error):error is ConstraintViolationError
Defined in: src/errors.ts:368
Whether error is the refusal of a write whose dependant another writer
changed after the write judged it (reasoninglayer#1245, #1251).
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 dependant_changed_concurrently; false otherwise.
Remarks
Section titled “Remarks”The body is the coded { error, code, message, refs }: refs.dependant
names the changed term (read it with errorBodyRefs), and
ConstraintViolationError.termId is undefined. Nothing is written.
Retry the write: the engine judges the term again. The same doors as
isDependantsExceedCommitBudget answer it.
Example
Section titled “Example”try { await client.terms.updateTerm(accountId, { features: { limit: 3 } });} catch (e) { if (isDependantChangedConcurrently(e)) retry();}