namespace AIStudio.Tools; /// /// Why reading a file failed. The Rust runtime reports these codes as part of the content /// stream, so the app can tell the user what happened instead of showing an empty document. /// public enum FileExtractionErrorCode { /// /// No failure happened. /// NONE, /// /// A code this version does not know, e.g. from a newer runtime. /// UNKNOWN, // // Codes reported by the Rust runtime: // INVALID_REQUEST, FILE_NOT_FOUND, FILE_NOT_READABLE, /// /// Another program holds the file open and denies reading it. /// FILE_LOCKED, FORMAT_DETECTION_FAILED, NOT_A_VALID_PDF, NOT_A_VALID_SPREADSHEET, PDFIUM_UNAVAILABLE, PDF_ENCRYPTED, PAGE_EXTRACTION_FAILED, NO_TEXT_EXTRACTED, /// /// The content does not match the file extension. This is a notice, not a failure: the file /// was read according to its content. /// EXTENSION_MISMATCH, /// /// The file was read as text, but its bytes are not text. /// NOT_TEXT_CONTENT, /// /// The file is an executable, no matter what its extension claims. /// EXECUTABLE_REJECTED, UNSUPPORTED, INTERNAL, // // Codes reported by the app itself: // /// /// Reading the file needs Pandoc, which is not available. /// PANDOC_UNAVAILABLE, /// /// The runtime answered with an unsuccessful HTTP status. /// REQUEST_FAILED, /// /// Reading the file took longer than the app is willing to wait. /// TIMEOUT, /// /// The runtime sent something the app could not deserialize. /// INVALID_RESPONSE, /// /// The extraction finished without reporting a failure, but produced no content at all. /// NO_CONTENT, }