namespace AIStudio.Tools; /// /// Thrown when a file could not be read, carrying the stable failure code along with the message. /// /// /// 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. /// public sealed class FileExtractionException(FileExtractionErrorCode code, string message, int? pageNumber = null, string? detectedFormat = null) : Exception(message) { /// /// Gets the stable failure code. /// public FileExtractionErrorCode Code { get; } = code; /// /// Gets the page the failure belongs to, when the failure affects a single page only. /// public int? PageNumber { get; } = pageNumber; /// /// Gets the format the runtime identified by looking at the content. /// public string? DetectedFormat { get; } = detectedFormat; }