Skip to content

Commit e8df3d8

Browse files
authored
fix: pass along error message when OCR fails (#176)
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!
1 parent 400e156 commit e8df3d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/server/routes/files/files.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ router.post('/', async (req, res) => {
438438
if (
439439
error.message?.includes('Invalid file format') ||
440440
error.message?.includes('No OCR result') ||
441-
error.message?.includes('exceeds token limit')
441+
error.message?.includes('exceeds token limit') ||
442+
error.message?.includes('Unable to extract text from')
442443
) {
443444
message = error.message;
444445
}

0 commit comments

Comments
 (0)