def requires_good_connection(fun):
 def _requires_good_connection(*args, **kwargs):
  try:
   return fun(*args, **kwargs)
  except ConnectionError:
   log.error('Either your ElasticSearch process is not quite ready to rumble, is not running at all, or ES_URLSis set wrong in your .env file.')
 return _requires_good_connection

def requires_good_connection ( fun ) : def _requires_good_connection ( * args , ** kwargs ) : try : return fun ( * args , ** kwargs ) except ConnectionError : log . error ( 'Either your ElasticSearch process is not quite ready to rumble, is not running at all, or ES_URLSis set wrong in your .env file.' ) return _requires_good_connection
decorator that logs an error on connection issues 9 out of 10 doctors say that connection errors are usually because es_urls is set wrong .