Enum EdgeErrorCode
- Namespace
- Qavren.Edge
- Assembly
- Qavren.Edge.Core.dll
Stable, programmatically handleable error identity for every EdgeException.
public enum EdgeErrorCode
Fields
Unknown = 0No error code was set. The default enum value; never assigned by a thrown EdgeException.
DuplicateDatabaseName = 1001Two databases were registered under the same name — either two
AddSqlitecalls collided, orAddMigrationfor a name was called before its matchingAddSqlite.Give each database a distinct name, and call
AddSqlitebefore adding migrations against it.NoNativeProviderRegistered = 1002No SQLite native provider was registered before the
Edgebuilder tried to open a database.Reference
Qavren.Edge.Sqlite.Nativeand callUseSqliteNative(), or referenceQavren.Edge.Sqlite.Native.Cipherand callUseSqliteNativeCipher().MultipleNativeProvidersRegistered = 1003More than one SQLite native provider is registered at once, so the builder cannot tell which one should back the database.
Reference exactly one of
Qavren.Edge.Sqlite.NativeorQavren.Edge.Sqlite.Native.Cipher— never both in the same app.EncryptionKeyWithoutCipherProvider = 1004A database has an encryption key configured but the registered native provider has no cipher codec, or a rekey was attempted on a database that is not encrypted.
Reference
Qavren.Edge.Sqlite.Native.Cipherand callUseSqliteNativeCipher()instead ofUseSqliteNative()whenever a key is configured.EncryptionKeyMissing = 1005A cipher-capable native provider is registered for a database whose configuration requires an encryption key, but none was supplied.
Set the key on the database's options (
AddSqlite(o => o.Key = ...)) before it is opened.NativeLoadFailed = 2001The native SQLite library (
qedge_sqlite3/qedge_sqlcipher) could not be loaded for the current runtime identifier.Raised as EdgeNativeException; inspect its
ProbedPathsandRuntimeIdentifierto confirm the native package's output for that RID was actually staged beside the app binary.NativeVerificationFailed = 2002The native library loaded, but a startup verification check against it failed — the binary is present but is not the one Qavren.Edge expects.
Confirm the native binary was not swapped, truncated, or built from a mismatched
native/versions.jsonpin; reinstall or rebuild the native package for the target RID.MigrationFailed = 3001A migration threw while running. The database is left at the last successfully applied
user_version; the failed migration was not partially committed.Fix the migration named in the exception message and rerun; the database remains usable at its prior version in the meantime.
MigrationVersionConflict = 3002The same migration version number was registered twice for one database.
Give each
AddMigrationcall for a database a unique, ascending version number.DatabaseKeyRejected = 4001A SQLCipher database refused the key it was opened with.
Confirm the key is correct, or that the file being opened is actually a SQLCipher database and not a plain SQLite file.
OnnxEnvironmentAlreadyCreated = 5001Another library created the ORT environment first. Logged, never thrown.
OnnxSessionCreationFailed = 5002Every execution provider, including the CPU fallback, failed to append, or the native ONNX Runtime library itself is missing.
Carries the RID, the probed path and every execution-provider attempt in EdgeNativeException's shape; confirm the ONNX Runtime native for the current RID is present and loadable.
OnnxModelSignatureMismatch = 5003The loaded graph declares an input the caller cannot supply.
The exception lists both the graph's declared input names and the names Qavren.Edge can produce; check for a mismatched model file or preset id.
OnnxExecutionProviderRequired = 5004An execution provider listed in the session policy's
Requiredset failed to append, and the policy does not allow falling through to CPU for that provider.Either remove the provider from
Required, or fix why it cannot append (a missing native asset, or an OS version below the provider's floor).OnnxInsufficientMemory = 5005The device's available memory is below the configured budget for the preset being loaded, checked before
new InferenceSessionruns.Carries both the required and available byte counts; use a smaller preset (an int8 variant), free memory before loading, or raise the configured memory budget.
OnnxUnsupportedRuntime = 5006osx-x64 and any RID with no ORT native.
OnnxStaticShapesUnpinned = 5007RequireStaticInputShapes set with no FreeDimensionOverrides.
ModelNotRegistered = 5051The requested model id was never declared by any registered model source.
Register the model before requesting it; check for a typo'd model or preset id.
ModelNotProvisioned = 5052The model is registered, but its files have not yet been downloaded or staged to local storage.
Provision the model explicitly, or let first-use auto-provisioning run, before using it.
ModelDownloadFailed = 5053Downloading the model's bytes failed — network failure, a non-2xx/206 response, or a server that ignored a
Rangerequest and forced a restart that then also failed.Check connectivity to the model source and retry; a server that consistently ignores
Rangerestarts the download from scratch every time by design.ModelHashMismatch = 5054The SHA-256 of a downloaded or staged file does not match the manifest, even after the one automatic retry.
Delete the cached file and re-download; confirm the manifest's recorded hash still matches the current revision of the source.
ModelAssetMissing = 5055A file the model's manifest requires (for example
vocab.txt) is not present on disk at load time.Re-provision the model bundle; confirm the model root directory was not partially deleted or moved.
ModelInsufficientDiskSpace = 5056Free disk space is short of the remaining bytes to download plus a safety margin, checked before the download starts.
Free disk space, or choose a smaller preset (an int8 variant).
TokenizerAssetMissing = 5101A file the tokenizer needs (for example
vocab.txt) is missing for the preset being loaded.Re-provision the model/tokenizer bundle; verify the configured model root path.
TokenizerKindUnsupported = 5102The requested tokenizer kind is not implemented yet — today this is any multilingual preset that needs a Unigram/SentencePiece tokenizer.
Use one of the shipped WordPiece/BERT-tokenized presets until multilingual support lands (see ADR 0006).
EmbeddingDimensionMismatch = 5103The embedding generator's actual output dimension does not match the dimension declared elsewhere — a preset's stated dimension, or a
DefaultModelDimensionsoverride.Confirm the configured preset and any dimension override agree with the preset's real output size.
EmbeddingPresetNotFound = 5104The requested preset id does not match any of the shipped
EmbeddingPresets.Check the spelling of the preset constant; only the four shipped presets exist in v1.
EmbeddingInputTooLong = 5105The input text, once tokenized, exceeds the sequence length the generator is configured to accept.
Shorten the input or chunk it into smaller pieces before embedding.
VectorCollectionNotFound = 5201The requested collection name has no matching table.
Call
EnsureCollectionExistsAsyncfirst, or check the collection name for a typo.UnsupportedKeyType = 5202The
[VectorStoreKey]property's CLR type is not one the provider supports.Use one of the four supported key types —
int,long,stringorGuid.UnsupportedPropertyType = 5203A data or vector property's CLR type has no SQL mapping in this provider.
Change the property's type to a supported one, or correct its
[VectorStoreData]/[VectorStoreVector]attribute.UnsupportedDistanceFunction = 5204The
DistanceFunctionset on[VectorStoreVector]is not onevec0supports.Use one of the three supported values —
CosineDistance(the default),EuclideanDistanceorManhattanDistance.VectorDimensionMismatch = 5205The embedding generator's dimension does not match the vector property's declared dimension.
Make
[VectorStoreVector(dims)]match the configured embedding generator's actual output dimension.FullTextPropertyMissing = 5206HybridSearchAsyncwas called on a record type with no[VectorStoreData(IsFullTextIndexed = true)]property.Mark at least one text property
IsFullTextIndexed = true, or callVectorSearchAsyncinstead of hybrid search.EmbeddingGeneratorMissing = 5207A
string-source vector property needs anIEmbeddingGenerator, and DI resolution (including the non-generic fallback) found none.Call
AddOnnxEmbeddings(or otherwise register a matchingIEmbeddingGenerator) beforeAddVectorStore.MultipleVectorPropertiesUnsupported = 5208The record type declares more than one
[VectorStoreVector]property; v1 supports exactly one.Keep exactly one vector property per record type.
NullableVectorProperty = 5209A vector property was declared nullable — rejected at model build time rather than left as a runtime null-means-skip trap on upsert.
Make the vector property's type non-nullable.
KnnLimitExceeded = 5210top + SkipexceedsSQLITE_VEC_VEC0_K_MAX,vec0's own cap onkfor a single KNN query. Raised before the query reaches SQLite.Reduce
topand/orSkipso their sum stays withinvec0'sklimit (4096).SqliteVersionTooOld = 5211The SQLite build in use predates the version the
vec0/FTS5 features this provider depends on require.Use the bundled
qedge_sqlite3native (Qavren.Edge.Sqlite.Native) rather than an external or OS-provided SQLite.VectorStoreOperationFailed = 5212A
SqliteExceptionsurfaced during a store operation and was wrapped so callers get one exception type across every operation.Inspect the wrapped
SqliteException(InnerException) for the underlying SQL error.ReservedColumnName = 5213A property claims the reserved "_rowid" storage name.
TokenCounterMissing = 6001No
IChunkTokenizeris resolvable at startup — there is deliberately no chars/4 fallback.Call
AddOnnxIngestion()to use the tokenizer, or register one withUseChunkTokenizer(...)/EdgeTokenCounter.CreateWordPiece(...).IngestionCollectionNotConfigured = 6002RunAsync,PruneAsync,GetStatusAsync,RemoveSourceAsyncorRemoveDocumentAsyncnamed acollectionNamethat noAddIngestioncall configured.Call
AddIngestionfor that collection, or pass null to use the single configured one.IngestionChunkBudgetInvalid = 6003The resolved chunk budget arithmetic is invalid, checked at startup once the resolved
IChunkTokenizeris known.Adjust
ChunkOptions(OverlapTokens,MinTokens,HeadingPathTokenBudget) or the model profile so the overhead, overlap and minimum token settings stay within the model's max sequence length.IngestionDuplicateExtractorId = 6004Two
IDocumentExtractors registered in theDocumentExtractorRegistrycomposition declared the sameId.Give each extractor a distinct
Id, or remove the duplicate registration.IngestionOptionsInvalid = 6005A tokenizer-independent ingestion option failed validation at registration.
The exception message names the offending value(s) — adjust
IngestionOptionsaccordingly before the next start.IngestionCollectionDimensionMismatch = 6006The embedding generator's
EmbeddingGeneratorMetadata.DefaultModelDimensionsdisagrees with the collection's declared dimensions.Use a generator whose dimensions match the collection, or reconfigure the collection to match the generator.
IngestionMigrationVersionConflict = 6007A second
AddIngestioncall was made for the same collection.Call
AddIngestiononce per collection; remove the duplicate call.IngestionRunAlreadyActive = 6008IngestionPipeline.RunAsyncwas called while a run is already active on the same pipeline, or a run and a removal (PruneAsync,RemoveSourceAsync,RemoveDocumentAsync) were asked to overlap.Await the active run's
IngestionRunResultbefore starting another run or a removal on the same pipeline, or use a separate pipeline/collection.IngestionRecipeChanged = 6009The recipe hash (chunking and extraction configuration) differs from the one the state store last recorded, and
StrictRecipeis set.With the default
StrictRecipe = falsethis is never thrown — affected documents are silently re-indexed and logged instead; withStrictRecipe = true, restore the prior configuration or accept the new recipe and re-run.IngestionRunAborted = 6010AbortAfterConsecutiveErrors(20) consecutive document failures were reached in one run.Inspect the inner exception and the per-document failures in
IngestionRunResult.Documents— twenty in a row usually means a systemic problem, not one bad file.IngestionCollectionSchemaMismatch = 6011The migration's collection DDL differs from the runtime store's
BuildCreateSql()for the same collection, checked at startup.Pass the same shaping values to
AddIngestion'sConfigureCollectionthat were passed toAddVectorStore.The configured folder is missing or unreadable, thrown before any document is processed.
Verify the path exists and the process has read access before calling
RunAsync.IngestionDocumentTooLarge = 6052A document exceeded
MaxDocumentBytes.Raise
MaxDocumentBytes, or exclude the oversized document from the source.IngestionDocumentUnreadable = 6053Opening the document raised
IOException/UnauthorizedAccessException, or a non-seekable stream exceededNonSeekableBufferLimitBytes.Verify the file still exists and is readable; for a non-seekable source, raise
NonSeekableBufferLimitBytesor supply a seekable stream.IngestionDuplicateDocumentId = 6054One
DocumentIdwas yielded twice within the same run.Make
DocumentSourceItem.DocumentId(or the source's id derivation) unique per run.IngestionSourceIdInvalid = 6055An
IngestionSourcefactory (Folder,Items) was given an invalidsourceId.Supply a non-empty, stable
sourceId— state rows are keyed on(collection, source_id, document_id).ExtractorNotFound = 6101No registered
IDocumentExtractorclaims the document's extension.Register the matching satellite (
AddPdfExtractor(),AddDocxExtractor()), or register a customIDocumentExtractorfor the extension.ExtractionFailed = 6102IDocumentExtractor.ExtractAsyncthrew something not already covered by DocumentEncrypted, DocumentMalformed, DocumentEncodingUndecodable or DocumentPageBudgetExceeded.The document is recorded
Failedand the run continues; one bad document fails one document, never a corpus.DocumentEncrypted = 6103PdfTextExtractorcould not open an encrypted PDF with the configuredPasswords.Add the document's password to
PdfExtractorOptions.Passwords, or exclude the document from the source.DocumentMalformed = 6104PdfTextExtractororDocxTextExtractorcould not parse the document's structure.Re-export or repair the source document; PdfPig's
UseLenientParsing(on by default) already tolerates the common cases.DocumentHasNoTextLayer = 6105Every page of a PDF has no text layer — a scanned document.
Run OCR upstream and re-ingest the result, or accept that the document is indexed as metadata only.
DocumentEncodingUndecodable = 6106PlainTextExtractorfound invalid UTF-8 withStrictUtf8set.Leave
StrictUtf8off (the default) to accept the Latin-1 fallback, or re-save the source file as valid UTF-8.DocumentPageBudgetExceeded = 6107A PDF's cumulative page-parse time passed
PageBudget, checked at a page boundary.Raise
PdfExtractorOptions.PageBudget, or exclude the document.ChunkExceedsTokenBudget = 6151A chunker emitted a chunk over
MaxTokens— an SP3 invariant violation, not a user-data problem.This should never happen on a shipped chunker; if it follows a custom chunker or tokenizer change, check its pre-yield token verification.
ChunkContextTooLong = 6152A chunk's heading-path breadcrumb still exceeds
HeadingPathTokenBudgetafter left-truncation.Raise
HeadingPathTokenBudget, shorten the document's heading structure, or setOverflowto the mode that honours truncation instead of throwing.ChunkTokenizerCeilingExceeded = 6153The resolved
IChunkTokenizer.MaxSequenceLengthdisagrees withChunkModelProfile.MaxSequenceLength.Use a tokenizer and a
ChunkModelProfilefor the same model — a mismatch means every number the budget resolves is a guess.ChunkerProducedEmptyChunk = 6154A chunker's pre-yield verification caught an empty chunk about to be emitted.
This should never happen on a shipped chunker; if it follows a custom chunker, check its emission logic.
MarkdownParseFailed = 6155MarkdownExtractor(Markdig) failed to parse the document.Validate the Markdown source, or extract it as plain text instead.
IngestionStateMissing = 6201IngestionStateStoreopened a database whose state tables do not exist.Call
AddIngestion(migrationVersion)so the migration creates the state tables before the first run.IngestionHashAlgorithmMismatch = 6202The state store's meta row records a hash algorithm different from the one the running code uses.
Delete the state rows and re-run to rebuild them under the current algorithm; this suite has no down-migrations.
IngestionStateSchemaUnsupported = 6203The state store's meta row records a schema version the running code does not understand (forward-only; no down-migrations).
Upgrade to the package version that wrote the state, or delete the state rows and re-run.
IngestionStateCorrupt = 6204A stored content hash is not the expected 16 bytes.
Delete the affected state row(s) and re-run so they are rebuilt cleanly.
IngestionCheckpointWriteFailed = 6205ChunkWriter's state-write step failed — disk full, orSQLITE_BUSYpastBusyTimeout.The transaction rolls back and the run aborts, so an unwritten checkpoint cannot make the next run believe finished work is still owed; free disk space, raise
BusyTimeout, or reduce write concurrency, then re-run.IngestionEmbeddingFailed = 6206SP3's own embed step (
GenerateAsync) threw.The runner halves the batch, retries the embed once, then suspends the run; inspect the inner exception, and for OnnxInsufficientMemory lower
WriteBatchSizeor the effective batch size.IngestionWriteFailed = 6207SP2's
UpsertAsyncorDeleteAsyncthrew.Reported, not retried; inspect the inner
EdgeVectorStoreExceptionfor the underlying store failure.IngestionEmbeddingGeneratorMissing = 6208No
IEmbeddingGenerator<string, Embedding<float>>is resolvable, unkeyed or keyed onStoreName, at startup.Call
AddOnnxEmbeddings()or register another matching generator beforeAddIngestion.ChatEnvironmentNotStarted = 7001A
Microsoft.ML.OnnxRuntimeGenAItype was reached before the startup task that starts it ran.Call
AddOnnxChat()and resolveIChatClientfrom the container rather than constructingEdgeChatClientdirectly.ChatModelLoadFailed = 7002new Model(...)ornew Tokenizer(...)threw anOnnxRuntimeGenAIException, or the load did not finish insideLoadTimeout.Carries the model directory and the inner message; re-provision the bundle if the files are damaged, or raise
LoadTimeoutif the device is simply slow to load.ChatModelNotRegistered = 7003A preset lookup (
ChatPresets.ById) was asked for an id that does not match any of the shipped presets.Check the spelling of the preset constant; only the shipped
ChatPresetsmembers exist in v1.ChatUnsupportedRuntime = 7004No ORT GenAI native for this RID or Android ABI. armeabi-v7a has none.
ChatInsufficientMemory = 7005The memory budget refused even at
MinContextTokens.Carries the required, available and total byte counts and the largest context that would have fit; try a smaller preset, a lower
MaxContextTokens, or the iOS increased-memory entitlements.ChatDeviceTooSmall = 7006Total device RAM is below the preset's floor, or the device reports
IsLowRamDevice.MinTotalMemoryBytescan be set to null to try anyway, at the risk of an OS kill.ChatConfigurationInvalid = 7007genai_config.json missing, unparseable or incoherent.
ChatModelShapeMismatch = 7008The config disagrees with the preset's declared shape.
ChatExecutionProviderUnsupported = 7009ConfigOverlayJsonnames an execution provider other than CPU on a mobile TFM, where GenAI has no CoreML and no NNAPI provider.Remove the provider override on mobile targets; CPU is the only execution provider chat supports there in v1 (see ADR 0009).
ChatModelNotProvisioned = 7051The model is absent on disk.
Carries the bundle's total byte count; call
IChatModelProvisioner.Plan(), show the consent sheet it feeds, thenProvisionAsync().ChatInsufficientDiskSpace = 7052Free disk space is short of the bundle total plus a safety margin, checked before the first byte.
Free disk space, or choose the smaller preset.
ChatDownloadNotPermitted = 7053ChatProvisioningOptions.IsTransferPermitted said no.
ChatTemplateUnsupported = 7101minja could not parse the model's chat template, and
RequireChatTemplateis set.Set
PromptFormatterto a formatter minja can parse, or a hand-written one.ChatPromptTooLong = 7102The prompt is still over budget after history reduction to the floor.
Carries both numbers; adjust
MaxOutputTokens,ChatHistoryOptions, orRagOptions.MaxContextTokens.ChatOptions.ResponseFormatis aChatResponseFormatJsonand the guidance policy isDisabled, orRequireNative/PreferNativeand the positive-control probe did not come backEnforced.The shipped mobile natives are built without
USE_GUIDANCE; setEdgeGuidancePolicy.PreferNativeto accept an unconstrained turn instead of a throw, or accept plain-text output.ChatGenerationFailed = 7104The native decode loop threw mid-decode.
Partial text already streamed stays streamed; the final update reports
StopReason = Errorbefore the exception surfaces. Inspect the inner exception and retry the turn.ChatBusy = 7105A second concurrent turn arrived while one was already running, the gate timed out, the queue is full, or turns are not being accepted.
The GenAI C API is not thread safe, so turns serialise onto one cached
Generator; queue the caller's own retry rather than starting a second turn concurrently.ChatThermalAbort = 7106Device thermal state is at or above
AbortAtbefore a turn starts.The same condition reached mid-decode instead completes the stream with
StopReason = Thermal; wait for the device to cool, or raiseAbortAt/ThrottleAtif the app's own UX already warns the user.ChatToolCallingUnsupported = 7107ChatOptions.Toolsis non-empty, orToolModerequires a call — unsupported on a ~1B on-device model in v1 (see ADR 0012).Remove
Tools/ToolModefrom the request, or perform tool calling above this client against a server-hosted model.ChatOptionUnsupported = 7108A message carries non-
TextContent, orSearchOptionssetsmax_lengthdirectly.max_lengthis refused whatever its type, because it is the memory cap the budget owns; useChatOptions.MaxOutputTokensand the memory budget instead.RagRetrieverMissing = 7201UseRag()was added to the pipeline but noIEdgeRetrieveris resolvable from the container.Register one with
AddVectorStoreRetriever/AddRetrieverbefore resolvingIChatClient.RagRetrievalFailed = 7202Retrieval threw and
ContinueOnRetrievalFailureis false, orTop + SkipexceededSQLITE_VEC_VEC0_K_MAX.Fix the retriever's collection or query, or lower
Top/Skipunder the vec0 candidate ceiling; leaveContinueOnRetrievalFailureat its default to get an ungrounded answer instead of a throw.RagCollectionNotSearchable = 7203RequireHybridSearchis true and the collection does not implementIKeywordHybridSearchable<TRecord>.Point the retriever at a collection that implements
IKeywordHybridSearchable<TRecord>, or leaveRequireHybridSearchat its default false to accept the vector-lane fallback.RagContextBudgetTooSmall = 7204MaxContextTokenscannot fit even one truncated source.Raise
RagOptions.MaxContextTokens, or lowerMaxCharsPerSourceso a single source fits inside the budget.