Skip to content

Commit

Permalink
Make sure that SearchIndexErrors *are* raised
Browse files Browse the repository at this point in the history
CKAN relies on the SearchIndexError being raised in the notify() call
of IDomainObjectNotification.  It still only logs most Exceptions, but
explicitly re-raises SearchIndexErrors as they are fatal to CKAN.
  • Loading branch information
rossjones committed Sep 8, 2015
1 parent 156348c commit f19705d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ckan/model/modification.py
@@ -1,5 +1,7 @@
import logging

from ckan.lib.search import SearchIndexError

import ckan.plugins as plugins
import domain_object
import package as _package
Expand Down Expand Up @@ -82,6 +84,9 @@ def notify(self, entity, operation):
plugins.IDomainObjectModification):
try:
observer.notify(entity, operation)
except SearchIndexError, search_error:
log.exception(search_error)
raise search_error
except Exception, ex:
log.exception(ex)

Expand All @@ -90,5 +95,8 @@ def notify_after_commit(self, entity, operation):
plugins.IDomainObjectModification):
try:
observer.notify_after_commit(entity, operation)
except SearchIndexError, search_error:
log.exception(search_error)
raise search_error
except Exception, ex:
log.exception(ex)

0 comments on commit f19705d

Please sign in to comment.