# High-level rest client ElasticsearchStatusException instead of VersionConflictEngineException

**URL:** <https://discuss.elastic.co/t/high-level-rest-client-elasticsearchstatusexception-instead-of-versionconflictengineexception/115871>\
**Category:** Elasticsearch\
**Created:** [January 17, 2018, 11:24am UTC](https://discuss.elastic.co/t/high-level-rest-client-elasticsearchstatusexception-instead-of-versionconflictengineexception/115871 "2018-01-17T11:24:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaughnd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vaughnd/32/13671_2.png) [@vaughnd](https://discuss.elastic.co/u/vaughnd)\
**Post date:** [January 17, 2018, 11:24am UTC](https://discuss.elastic.co/t/high-level-rest-client-elasticsearchstatusexception-instead-of-versionconflictengineexception/115871/1 "2018-01-17T11:24:27Z")

</div>

Hi,

I used to catch DocumentAlreadyExistsException from the java TransportClient, but I'm busy migrating to ES 6 and the docs say it's now VersionConflictEngineException. My problem is that I only get ElasticsearchStatusException from the high-level rest client, and not the specific exception. Is there a best practice for handling this or converting the embedded exception in to the relevant exception?

org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=version\_conflict\_engine\_exception, reason=[siteConfig][test1]: version conflict, document already exists (current version [1])]

Thanks,  
Vaughn

---

<div class="post-metadata">

**Author:** ![Kevin\_Bourne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_bourne/32/53053_2.png) [@Kevin\_Bourne](https://discuss.elastic.co/u/Kevin_Bourne)\
**Post date:** [January 18, 2018, 5:02pm UTC](https://discuss.elastic.co/t/high-level-rest-client-elasticsearchstatusexception-instead-of-versionconflictengineexception/115871/2 "2018-01-18T17:02:14Z")

</div>

Having the same type of problem, mainly it is not clearly stated in the documentation when and what exceptions are thrown and for what reason.

---

<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:** [February 15, 2018, 5:02pm UTC](https://discuss.elastic.co/t/high-level-rest-client-elasticsearchstatusexception-instead-of-versionconflictengineexception/115871/3 "2018-02-15T17:02:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
