mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-14 13:13:48 +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
@@ -0,0 +1,27 @@
|
||||
namespace AIStudio.Tools;
|
||||
|
||||
/// <summary>
|
||||
/// Thrown when a file could not be read, carrying the stable failure code along with the message.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The plain message alone does not say whether another attempt is worth anything. The code does,
|
||||
/// which is what the indexer needs to tell a file without readable text apart from a network drive
|
||||
/// which happens to be offline.
|
||||
/// </remarks>
|
||||
public sealed class FileExtractionException(FileExtractionErrorCode code, string message, int? pageNumber = null, string? detectedFormat = null) : Exception(message)
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the stable failure code.
|
||||
/// </summary>
|
||||
public FileExtractionErrorCode Code { get; } = code;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the page the failure belongs to, when the failure affects a single page only.
|
||||
/// </summary>
|
||||
public int? PageNumber { get; } = pageNumber;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the format the runtime identified by looking at the content.
|
||||
/// </summary>
|
||||
public string? DetectedFormat { get; } = detectedFormat;
|
||||
}
|
||||
Reference in new issue
Block a user