Localize the messages of failed indexing attempts

This commit is contained in:
Thorsten Sommer committed 2026-09-09 13:23:12 +02:00
1 parent 2b18d32bf2
commit f094cb6ac5
7 files changed
+66 -10

No files matched your search

@@ -267,8 +267,12 @@ public sealed partial class RustService
{
await foreach (var segment in this.StreamArbitraryFileDataCore(path, false, true, embeddingProvider.TokenizerPath, token))
{
//
// Carries a code so callers can classify it: the file itself is fine, the answer of
// the runtime was not, which makes this worth another attempt.
//
if (segment.TokenCount is null)
throw new InvalidOperationException($"Rust did not return a token count for an extracted segment from '{path}' using provider '{embeddingProvider.Name}'.");
throw new FileExtractionException(FileExtractionErrorCode.INVALID_RESPONSE, $"Rust did not return a token count for an extracted segment from '{path}' using provider '{embeddingProvider.Name}'.");
yield return new(segment.Content, segment.TokenCount.Value);
}