From 3cf91430596f60c962e1d2069d5c36c3ce07460d Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 5 Jan 2015 03:20:05 -0400 Subject: [PATCH] Log error when language cleanup backend fails --- mayan/apps/ocr/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mayan/apps/ocr/api.py b/mayan/apps/ocr/api.py index ffa35e9f12..f0189a09df 100644 --- a/mayan/apps/ocr/api.py +++ b/mayan/apps/ocr/api.py @@ -95,7 +95,11 @@ def ocr_cleanup(language, text): line = line.strip() for word in line.split(): if language_backend: - result = language_backend.check_word(word) + try: + result = language_backend.check_word(word) + except Exception as exception: + logger.error(exception) + raise Exception('ocr_cleanup() %s' % unicode(exception)) else: result = word if result: