X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/dd6284e01f00296294a527ded7e840ac14c5fbb8..4cf27ad4ae5ac3610e857379b2a788582580aa5b:/apps/catalogue/tasks.py?ds=sidebyside diff --git a/apps/catalogue/tasks.py b/apps/catalogue/tasks.py index 86e84a511..e1ff9151a 100755 --- a/apps/catalogue/tasks.py +++ b/apps/catalogue/tasks.py @@ -5,6 +5,7 @@ from datetime import datetime from celery.task import task import catalogue.models +from traceback import print_exc @task def touch_tag(tag): @@ -18,4 +19,9 @@ def touch_tag(tag): @task def index_book(book_id, book_info=None): - return catalogue.models.Book.objects.get(id=book_id).search_index(book_info) + try: + return catalogue.models.Book.objects.get(id=book_id).search_index(book_info) + except Exception, e: + print "Exception during index: %s" % e + print_exc() + raise e