Function: osfqlContainmentRefusalOf()
@kortexya/reasoninglayer / osfqlContainmentRefusalOf
Function: osfqlContainmentRefusalOf()
Section titled “Function: osfqlContainmentRefusalOf()”osfqlContainmentRefusalOf(
error):OsfqlContainmentRefusal|undefined
Defined in: src/utils/osfql-containment-refusal.ts:37
Read the 422 osfql_not_conjunctive refusal of
OsfqlClient.containment from the error the SDK threw for it.
Parameters
Section titled “Parameters”unknown
What a catch received.
Returns
Section titled “Returns”OsfqlContainmentRefusal | undefined
The refusal — status, code, message and the refused side — or
undefined when error is not a containment refusal.
Throws
Section titled “Throws”Never. Anything that is not a containment refusal answers undefined.
Remarks
Section titled “Remarks”The engine’s OsfqlContainmentRefusal ({error, code, message, side}): a
query that does not parse, or is outside the conjunctive fragment, is
refused rather than answered not_proven. The body is the raw wire, so
every field is read and checked; a body that does not have the shape
answers undefined.
Example
Section titled “Example”try { await client.osfql.containment({ left, right });} catch (error) { const refusal = osfqlContainmentRefusalOf(error); if (refusal === undefined) throw error; console.log(`the ${refusal.side} query is not conjunctive: ${refusal.message}`);}