From 0f516efcf8356c19493ec261b654449c27d2ce88 Mon Sep 17 00:00:00 2001 From: David Read Date: Tue, 8 Sep 2015 14:56:32 +0000 Subject: [PATCH] Added comment to explain. --- ckan/model/modification.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ckan/model/modification.py b/ckan/model/modification.py index d8bbcaad665..c06c72902b9 100644 --- a/ckan/model/modification.py +++ b/ckan/model/modification.py @@ -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( @@ -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.