Function: errorBodyRefs()
@kortexya/reasoninglayer / errorBodyRefs
Function: errorBodyRefs()
Section titled “Function: errorBodyRefs()”errorBodyRefs(
error):Record<string,string> |undefined
Defined in: src/utils/error-code.ts:107
The records an engine error body names by role, from an ApiError’s body.
Parameters
Section titled “Parameters”unknown
Anything caught from an SDK call.
Returns
Section titled “Returns”Record<string, string> | undefined
The body’s refs map (role → term id) without its non-string
entries, or undefined when the error is not an ApiError or its
body carries no refs object.
Remarks
Section titled “Remarks”The engine’s coded body { error, code, message, refs } names the records
a client acts on: dependant for dependant_changed_concurrently
(reasoninglayer#1245), term for term_changed_concurrently (#1263), passage and passage_review for
source_passage_unconfirmed. Branch on errorBodyCode, then read
the role that code documents.
Example
Section titled “Example”try { await client.terms.updateTerm(accountId, { features: { limit: 3 } });} catch (error) { if (errorBodyCode(error) === 'dependant_changed_concurrently') { console.log('changed meanwhile:', errorBodyRefs(error)?.dependant); }}