fix(server): resolve incorrect document failure titles

This commit is contained in:
perf3ct 2025-07-08 20:24:52 +00:00
parent 12bdeab503
commit e628b0d4d5
2 changed files with 2 additions and 3 deletions

View File

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

View File

@ -946,9 +946,9 @@ impl OcrQueueService {
/// Helper function to map OCR error strings to standardized failure reasons /// Helper function to map OCR error strings to standardized failure reasons
fn classify_ocr_error(error_str: &str) -> (&'static str, bool) { fn classify_ocr_error(error_str: &str) -> (&'static str, bool) {
if error_str.contains("font encoding") || error_str.contains("missing unicode map") { 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") { } 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") { } else if error_str.contains("timeout") || error_str.contains("timed out") {
("ocr_timeout", false) ("ocr_timeout", false)
} else if error_str.contains("memory") || error_str.contains("out of memory") { } else if error_str.contains("memory") || error_str.contains("out of memory") {