LibreChat/api/server/routes/files
Danny Avila 365a0dc0f6
🩺 refactor: Surface Descriptive OCR Error Messages to Client (#12344)
* fix: pass along error message when OCR fails

Right now, if OCR fails, it just says "Error processing file" which
isn't very helpful.

The `error.message` does has helpful information in it, but our
filter wasn't including the right case to pass it along. Now it does!

* fix: extract shared upload error filter, apply to images route

The 'Unable to extract text from' error was only allowlisted in the
files route but not the images route, which also calls
processAgentFileUpload. Extract the duplicated error filter logic
into a shared resolveUploadErrorMessage utility in packages/api so
both routes stay in sync.

---------

Co-authored-by: Dan Lew <daniel@mightyacorn.com>
2026-03-20 17:10:25 -04:00
..
speech 🧹 chore: Cleanup Logger and Utility Imports (#9935) 2025-10-01 23:30:47 -04:00
avatar.js 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
files.agents.test.js 📎 fix: Allow Message Attachments for Users with Viewer Permission on Agents (#11210) 2026-01-05 13:44:59 -05:00
files.js 🩺 refactor: Surface Descriptive OCR Error Messages to Client (#12344) 2026-03-20 17:10:25 -04:00
files.test.js 🧵 refactor: Migrate Endpoint Initialization to TypeScript (#10794) 2025-12-11 16:37:16 -05:00
images.agents.test.js 🛡️ fix: Agent Permission Check on Image Upload Route (#12219) 2026-03-14 02:57:56 -04:00
images.js 🩺 refactor: Surface Descriptive OCR Error Messages to Client (#12344) 2026-03-20 17:10:25 -04:00
index.js 📦 chore: Bump Express.js to v5 (#10671) 2025-12-11 16:36:15 -05:00
multer.js 📂 refactor: Cleanup File Filtering Logic, Improve Validation (#10414) 2025-11-10 19:05:30 -05:00
multer.spec.js 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00