Skip to content
Snippets Groups Projects
Commit 1c4e7b35e611 authored by David Douard's avatar David Douard
Browse files

[ccplugin] do not crash if an entity failed to serialize

otherwise the import just hand forever.
parent 6bd462ae5a6c
No related branches found
No related tags found
No related merge requests found
...@@ -102,8 +102,14 @@ ...@@ -102,8 +102,14 @@
cnx.debug(u'RQL: {}'.format(rql)) cnx.debug(u'RQL: {}'.format(rql))
for entity in rset.entities(): for entity in rset.entities():
serializer = entity.cw_adapt_to('IFullTextIndexSerializable') try:
json = serializer.serialize() serializer = entity.cw_adapt_to('IFullTextIndexSerializable')
json = serializer.serialize()
except Exception as e:
cnx.error('[{}] Failed to serialize entity {} ({})'.format(
index_name, entity.eid, etype))
continue
if not dry_run and json: if not dry_run and json:
# Entities with # Entities with
# fulltext_containers relations return their container # fulltext_containers relations return their container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment