How to use the elasticsearch5.ElasticsearchException function in elasticsearch5

To help you get started, we’ve selected a few elasticsearch5 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cisco / mindmeld / mindmeld / components / _elasticsearch_helpers.py View on Github external
return es_client.indices.exists(index=scoped_index_name)
    except EsConnectionError as e:
        logger.debug(
            "Unable to connect to Elasticsearch: %s details: %s", e.error, e.info
        )
        raise KnowledgeBaseConnectionError(es_host=es_client.transport.hosts)
    except TransportError as e:
        logger.error(
            "Unexpected error occurred when sending requests to Elasticsearch: %s "
            "Status code: %s details: %s",
            e.error,
            e.status_code,
            e.info,
        )
        raise KnowledgeBaseError
    except ElasticsearchException:
        raise KnowledgeBaseError
github cisco / mindmeld / mindmeld / components / question_answerer.py View on Github external
return results
        except EsConnectionError as e:
            logger.error(
                "Unable to connect to Elasticsearch: %s details: %s", e.error, e.info
            )
            raise KnowledgeBaseConnectionError(es_host=self.client.transport.hosts)
        except TransportError as e:
            logger.error(
                "Unexpected error occurred when sending requests to Elasticsearch: %s "
                "Status code: %s details: %s",
                e.error,
                e.status_code,
                e.info,
            )
            raise KnowledgeBaseError
        except ElasticsearchException:
            raise KnowledgeBaseError