# HG changeset patch
# User Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
# Date 1492098671 -7200
#      Thu Apr 13 17:51:11 2017 +0200
# Node ID c76981d1489836fcd52e037723eea6ac77f8c23b
# Parent  752500a2dd66f580feca39260c5b1dcab670b1a2
[hooks] make sure we keep of any exception when trying to index

diff --git a/cubicweb_elasticsearch/hooks.py b/cubicweb_elasticsearch/hooks.py
--- a/cubicweb_elasticsearch/hooks.py
+++ b/cubicweb_elasticsearch/hooks.py
@@ -110,3 +110,6 @@
                 es.index(**kwargs)
             except (ConnectionError, ProtocolError):
                 log.warning('Failed to index in hook, could not connect to ES')
+            except Exception as exc:
+                log.exception('Failed to index in hook')
+                raise