Smarted exception catching
This commit is contained in:
@@ -84,9 +84,6 @@ def cascade_eval(eval_dict, document, template_node, parent_index_instance=None)
|
|||||||
except (NameError, AttributeError), exc:
|
except (NameError, AttributeError), exc:
|
||||||
warnings.append(_(u'Error in document indexing update expression: %(expression)s; %(exception)s') % {
|
warnings.append(_(u'Error in document indexing update expression: %(expression)s; %(exception)s') % {
|
||||||
'expression': template_node.expression, 'exception': exc})
|
'expression': template_node.expression, 'exception': exc})
|
||||||
except Exception, exc:
|
|
||||||
warnings.append(_(u'Error updating document index, expression: %(expression)s; %(exception)s') % {
|
|
||||||
'expression': template_node.expression, 'exception': exc})
|
|
||||||
else:
|
else:
|
||||||
if result:
|
if result:
|
||||||
index_instance, created = IndexInstanceNode.objects.get_or_create(index_template_node=template_node)
|
index_instance, created = IndexInstanceNode.objects.get_or_create(index_template_node=template_node)
|
||||||
@@ -94,7 +91,12 @@ def cascade_eval(eval_dict, document, template_node, parent_index_instance=None)
|
|||||||
index_instance.parent = parent_index_instance
|
index_instance.parent = parent_index_instance
|
||||||
index_instance.save()
|
index_instance.save()
|
||||||
#if created:
|
#if created:
|
||||||
|
try:
|
||||||
fs_create_index_directory(index_instance)
|
fs_create_index_directory(index_instance)
|
||||||
|
except Exception, exc:
|
||||||
|
warnings.append(_(u'Error updating document index, expression: %(expression)s; %(exception)s') % {
|
||||||
|
'expression': template_node.expression, 'exception': exc})
|
||||||
|
|
||||||
if template_node.link_documents:
|
if template_node.link_documents:
|
||||||
suffix = find_lowest_available_suffix(index_instance, document)
|
suffix = find_lowest_available_suffix(index_instance, document)
|
||||||
document_count = DocumentRenameCount(
|
document_count = DocumentRenameCount(
|
||||||
@@ -104,7 +106,12 @@ def cascade_eval(eval_dict, document, template_node, parent_index_instance=None)
|
|||||||
)
|
)
|
||||||
document_count.save()
|
document_count.save()
|
||||||
|
|
||||||
|
try:
|
||||||
fs_create_document_link(index_instance, document, suffix)
|
fs_create_document_link(index_instance, document, suffix)
|
||||||
|
except Exception, exc:
|
||||||
|
warnings.append(_(u'Error updating document index, expression: %(expression)s; %(exception)s') % {
|
||||||
|
'expression': template_node.expression, 'exception': exc})
|
||||||
|
|
||||||
index_instance.documents.add(document)
|
index_instance.documents.add(document)
|
||||||
|
|
||||||
for child in template_node.get_children():
|
for child in template_node.get_children():
|
||||||
|
|||||||
Reference in New Issue
Block a user