Type Alias: DocumentVersionErrorCode
@kortexya/reasoninglayer / DocumentVersionErrorCode
Type Alias: DocumentVersionErrorCode
Section titled “Type Alias: DocumentVersionErrorCode”DocumentVersionErrorCode =
"previous_document_not_found"|"duplicate_document_version_conflict"
Defined in: src/types/ingestion.ts:2244
The code of a document-version refusal of POST /api/v1/ingest/markdown
and POST /api/v1/ingest/document.
Remarks
Section titled “Remarks”'previous_document_not_found'(HTTP 404,NotFoundError) — thepreviousDocumentIdnames no document of this tenant, or is not a UUID. Nothing is ingested.'duplicate_document_version_conflict'(HTTP 409,ConstraintViolationError) — the bytes were already ingested as a document that already has other versions, so it cannot also become the next version ofpreviousDocumentId.
On an asynchronous ingest (sync: false) the same refusal ends the session
document as failed with that message instead.
Example
Section titled “Example”try { await client.ingestion.ingestMarkdown({ content, config: { previousDocumentId } });} catch (e) { const code = errorBodyCode(e); if (code === 'previous_document_not_found') console.warn('the previous version is gone');}