Function: isDependantsExceedCommitBudget()
@kortexya/reasoninglayer / isDependantsExceedCommitBudget
Function: isDependantsExceedCommitBudget()
Section titled “Function: isDependantsExceedCommitBudget()”isDependantsExceedCommitBudget(
error):error is ConstraintViolationError
Defined in: src/errors.ts:310
Whether error is the refusal of a write that would adjust more dependants
than one commit can hold (reasoninglayer#1245).
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 dependants_exceed_commit_budget; false otherwise.
Remarks
Section titled “Remarks”A dependant is a term whose bound constraint reads a feature the write
changes. A write re-judges its dependants in the same commit, and refuses
the whole write when there are more of them than that commit can hold. The
message names the count and the budget; nothing is written. The term
write doors answer it: PUT /api/v1/terms/{id}, POST /api/v1/terms
(a @key merge), POST /api/v1/terms/bulk, POST /api/v1/inference/facts
and POST /api/v1/actions/apply. Split the change into smaller writes.
Example
Section titled “Example”try { await client.terms.updateTerm(accountId, { features: { limit: 3 } });} catch (e) { if (isDependantsExceedCommitBudget(e)) splitTheChange();}