Skip to content

Commit

Permalink
Added comment to explain.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Sep 8, 2015
1 parent f19705d commit 0f516ef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ckan/model/modification.py
Expand Up @@ -86,9 +86,13 @@ def notify(self, entity, operation):
observer.notify(entity, operation)
except SearchIndexError, search_error:
log.exception(search_error)
# Reraise, since it's pretty crucial to ckan if it can't index
# a dataset
raise search_error
except Exception, ex:
log.exception(ex)
# Don't reraise other exceptions since they are generally of
# secondary importance so shouldn't disrupt the commit.

def notify_after_commit(self, entity, operation):
for observer in plugins.PluginImplementations(
Expand All @@ -97,6 +101,10 @@ def notify_after_commit(self, entity, operation):
observer.notify_after_commit(entity, operation)
except SearchIndexError, search_error:
log.exception(search_error)
# Reraise, since it's pretty crucial to ckan if it can't index
# a dataset
raise search_error
except Exception, ex:
log.exception(ex)
# Don't reraise other exceptions since they are generally of
# secondary importance so shouldn't disrupt the commit.

0 comments on commit 0f516ef

Please sign in to comment.