# Elasticsearch Update API DocumentMissingException

**URL:** <https://discuss.elastic.co/t/elasticsearch-update-api-documentmissingexception/34236>\
**Category:** Elasticsearch\
**Created:** [November 10, 2015, 12:38pm UTC](https://discuss.elastic.co/t/elasticsearch-update-api-documentmissingexception/34236 "2015-11-10T12:38:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![George](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@George](https://discuss.elastic.co/u/George)\
**Post date:** [November 10, 2015, 12:38pm UTC](https://discuss.elastic.co/t/elasticsearch-update-api-documentmissingexception/34236/1 "2015-11-10T12:38:24Z")

</div>

Hello,

I'm using elasticsearch client java API 1.6.0 and have a groovy script which deletes attributes from a document. When I execute my script against a non-existent document I get DocumentMissingException. I handle this situation silently by ignoring the exception. Isn't there a better way to do this without catching exceptions? Like an automatic noop detection when doc is not there and the update is not a scriptedUpsert?

Best regards!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:39pm UTC](https://discuss.elastic.co/t/elasticsearch-update-api-documentmissingexception/34236/2 "2017-07-05T23:39:30Z")

</div>


