Function: isDependantNotWritable()
@kortexya/reasoninglayer / isDependantNotWritable
Function: isDependantNotWritable()
Section titled “Function: isDependantNotWritable()”isDependantNotWritable(
error):error is ConstraintViolationError
Defined in: src/errors.ts:340
Whether error is the refusal of a write whose dependant the caller may
not write as adjusted (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_not_writable; false otherwise.
Remarks
Section titled “Remarks”An update bound constraint of a term that reads the written feature
would adjust that term, and the caller reads it but may not write it.
ConstraintViolationError.termId names that term, not the written
one; the message names the guard that refused it. Nothing is written. The
same doors as isDependantsExceedCommitBudget answer it.
Example
Section titled “Example”try { await client.terms.updateTerm(accountId, { features: { limit: 3 } });} catch (e) { if (isDependantNotWritable(e)) askTheOwnerOf(e.termId);}