Skip to content

Function: osfqlContainmentRefusalOf()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / 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.

unknown

What a catch received.

OsfqlContainmentRefusal | undefined

The refusal — status, code, message and the refused side — or undefined when error is not a containment refusal.

Never. Anything that is not a containment refusal answers undefined.

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.

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}`);
}