# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1474475076 -7200
#      Wed Sep 21 18:24:36 2016 +0200
# Node ID 80e684bb4b316e87087101845e935ff686d20968
# Parent  f8f0f9d187af9a5513ca67a1faa29438e75a69ad
[es] don't try/except on index creation, now only used in ccplugin and scripts, fail hard so we can see the index settings errors

diff --git a/es.py b/es.py
--- a/es.py
+++ b/es.py
@@ -17,7 +17,7 @@
 
 import logging
 
-from elasticsearch.exceptions import ConnectionError, TransportError
+from elasticsearch.exceptions import ConnectionError
 from urllib3.exceptions import ProtocolError
 from elasticsearch_dsl.connections import connections
 
@@ -109,11 +109,8 @@
     """
     try:
         if not es.indices.exists(index=index_name):
-            try:
-                es.indices.create(index=index_name,
-                                  body=settings)
-            except TransportError:
-                log.error('Failed to create index {}'.format(index_name))
+            es.indices.create(index=index_name,
+                              body=settings)
     except (ConnectionError, ProtocolError):
         log.debug('Failed to index in hook, could not connect to ES')