fix(server): resolve incorrect document failure titles

This commit is contained in:
perf3ct 2025-07-08 20:24:52 +00:00
parent bb2bf890d3
commit 8b1cf027a3
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
2 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@ use axum::{
routing::get,
Router,
};
use sqlx::Row;
use std::sync::Arc;
use tower_http::{cors::CorsLayer, services::{ServeDir, ServeFile}};
use tracing::{info, error, warn};

View File

@ -946,9 +946,9 @@ impl OcrQueueService {
/// Helper function to map OCR error strings to standardized failure reasons
fn classify_ocr_error(error_str: &str) -> (&'static str, bool) {
if error_str.contains("font encoding") || error_str.contains("missing unicode map") {
("pdf_font_encoding", true)
("pdf_parsing_error", true) // Font encoding issues are PDF parsing problems
} else if error_str.contains("corrupted internal structure") || error_str.contains("corrupted") {
("pdf_corruption", true)
("file_corrupted", true) // Corrupted files should use file_corrupted
} else if error_str.contains("timeout") || error_str.contains("timed out") {
("ocr_timeout", false)
} else if error_str.contains("memory") || error_str.contains("out of memory") {