# Catching exceptions from saveToEs (elasticsearch-spark)

**URL:** <https://discuss.elastic.co/t/catching-exceptions-from-savetoes-elasticsearch-spark/53745>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [June 23, 2016, 7:53am UTC](https://discuss.elastic.co/t/catching-exceptions-from-savetoes-elasticsearch-spark/53745 "2016-06-23T07:53:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nvitucci](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nvitucci/32/22892_2.png) [@nvitucci](https://discuss.elastic.co/u/nvitucci)\
**Post date:** [July 6, 2016, 1:04pm UTC](https://discuss.elastic.co/t/catching-exceptions-from-savetoes-elasticsearch-spark/53745/3 "2016-07-06T13:04:13Z")

</div>

Well, if there's a failure on the Elasticsearch side, I'd like to be able to fail gracefully - and not to have my whole job fail. In my specific case there is no simple way to do the checks beforehand, so handling the exception would be easier. Do you see any solutions to this? Maybe a `saveToEs` parameter to "ignore" the exceptions and log them somewhere?

---

_[View the full topic](https://discuss.elastic.co/t/catching-exceptions-from-savetoes-elasticsearch-spark/53745)._
