# HG changeset patch
# User Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
# Date 1492098779 -7200
#      Thu Apr 13 17:52:59 2017 +0200
# Node ID 5d5e980390d8c570204ca57ff8b44e220259fb58
# Parent  3e4d4721e8228160321e805ca81feef2d5965449
[tests] flake8

diff --git a/cubicweb_elasticsearch/hooks.py b/cubicweb_elasticsearch/hooks.py
--- a/cubicweb_elasticsearch/hooks.py
+++ b/cubicweb_elasticsearch/hooks.py
@@ -108,7 +108,7 @@
             try:
                 # TODO option for async ?
                 es.index(**kwargs)
-            except (ConnectionError, ProtocolError):
+            except (ConnectionError, ProtocolError) as exc:
                 log.warning('Failed to index in hook, could not connect to ES')
             except Exception as exc:
                 log.exception('Failed to index in hook')