Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try:
if self._use_text_rel:
scoped_index_name = get_scoped_index_name(
self._app_namespace, self._es_index_name
)
if not self._es_client.indices.exists(index=scoped_index_name):
self.fit()
else:
self.fit()
except EsConnectionError as e:
logger.error(
"Unable to connect to Elasticsearch: %s details: %s", e.error, e.info
)
raise EntityResolverConnectionError(es_host=self._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 EntityResolverError
except ElasticsearchException:
raise EntityResolverError