mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 13:37:59 +00:00
Carry the extraction failure code into the indexer
This commit is contained in:
4 files changed
+129
-2
No files matched your search
@@ -769,8 +769,13 @@ public sealed partial class DataSourceEmbeddingService(SettingsManager settingsM
|
||||
if (batch.Count > 0)
|
||||
await this.FlushBatchAsync(indexStore, vectorStore, dataSource, file, fingerprint, parentFile, embeddingProvider, provider, manifest, optimizationTracker, collectionName, batch, token);
|
||||
|
||||
//
|
||||
// The extraction itself did not report a failure, but nothing usable came out of it. For
|
||||
// the index this is the same case as a scanned page without a text layer, which is why it
|
||||
// carries a code of its own instead of an unclassified exception:
|
||||
//
|
||||
if (totalChunkCount == 0)
|
||||
throw new InvalidOperationException(string.Format(TB("No text could be read from the file '{0}'."), file.Name));
|
||||
throw new FileExtractionException(FileExtractionErrorCode.NO_CONTENT, string.Format(TB("No text could be read from the file '{0}'."), file.Name));
|
||||
|
||||
logger.LogDebug(
|
||||
"Generated {ChunkCount} chunks for file '{FilePath}' in data source '{DataSourceName}' ({DataSourceId}).",
|
||||
|
||||
@@ -372,7 +372,7 @@ public sealed partial class RustService
|
||||
error.DetectedFormat,
|
||||
error.Message);
|
||||
|
||||
throw new InvalidOperationException($"Rust could not extract '{path}': {error.Message}");
|
||||
throw new FileExtractionException(error.ParsedCode, $"Rust could not extract '{path}': {error.Message}", error.PageNumber, error.DetectedFormat);
|
||||
}
|
||||
|
||||
if (processedEvent.PromptInjection is { } promptInjection)
|
||||
|
||||
Reference in new issue
Block a user