diff --git a/cubicweb_elasticsearch/ccplugin.py b/cubicweb_elasticsearch/ccplugin.py index 6bd462ae5a6c28925a07f17f3fc4f92a5dc5658b_Y3ViaWN3ZWJfZWxhc3RpY3NlYXJjaC9jY3BsdWdpbi5weQ==..1c4e7b35e611717b8167756ac269d365500c8597_Y3ViaWN3ZWJfZWxhc3RpY3NlYXJjaC9jY3BsdWdpbi5weQ== 100644 --- a/cubicweb_elasticsearch/ccplugin.py +++ b/cubicweb_elasticsearch/ccplugin.py @@ -102,8 +102,14 @@ cnx.debug(u'RQL: {}'.format(rql)) for entity in rset.entities(): - serializer = entity.cw_adapt_to('IFullTextIndexSerializable') - json = serializer.serialize() + try: + 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: # Entities with # fulltext_containers relations return their container