Skip to content

Type Alias: LiveSourceErrorCode

@kortexya/reasoninglayer


@kortexya/reasoninglayer / LiveSourceErrorCode

LiveSourceErrorCode = "source_query_failed" | "source_stream_failed" | "source_timeout"

Defined in: src/types/ontology-bridge.ts:477

The code of a coded refusal that a live read of a bound source answers (reasoninglayer#1213, #1218).

client.ontologyBridge.executeTranspiled (POST /api/v1/ontology/query) and the discovery and key count that bindSort (POST /api/v1/ontology/bindings) runs answer these instead of a partial or empty row list:

  • source_query_failed (502) — the source refused or failed the query, or could not be reached;
  • source_stream_failed (502) — the source accepted the query and its row stream failed before its end; no partial rows are returned;
  • source_timeout (504) — the read did not reach the end of its row stream within the source’s query_timeout_secs.

Read the code with errorBodyCode(error). A source with no native query backend answers 501, with no code: nothing failed.

try {
await client.ontologyBridge.executeTranspiled({ osfql: 'customer(name: N)' });
} catch (error) {
if (errorBodyCode(error) === 'source_timeout') retryLater();
}