ElasticSearchHandler: fixing exceptions