# Java agent APM and valid errors

**URL:** <https://discuss.elastic.co/t/java-agent-apm-and-valid-errors/317685>\
**Category:** APM\
**Tags:** java\
**Created:** [October 28, 2022, 1:19pm UTC](https://discuss.elastic.co/t/java-agent-apm-and-valid-errors/317685 "2022-10-28T13:19:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan44785372](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivan44785372/32/38610_2.png) [@Ivan44785372](https://discuss.elastic.co/u/Ivan44785372)\
**Post date:** [October 28, 2022, 1:19pm UTC](https://discuss.elastic.co/t/java-agent-apm-and-valid-errors/317685/1 "2022-10-28T13:19:25Z")

</div>

I can see that all "valid" errors, when I throw my own exception and handle them like this

```auto
if (N > 0) {
   throw new MyCustomException();
}

```

All such "errors" shows in "Errors" page in APM, but these are not real errors .  
Is it possible somehow not to count such exceptions as errors or I need to rewrite my code ?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [October 31, 2022, 4:45am UTC](https://discuss.elastic.co/t/java-agent-apm-and-valid-errors/317685/2 "2022-10-31T04:45:22Z")

</div>

Yes, it is possible through the [`ignore_exceptions`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-ignore-exceptions) config option.

---

<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:** [November 21, 2022, 12:45am UTC](https://discuss.elastic.co/t/java-agent-apm-and-valid-errors/317685/3 "2022-11-21T00:45:50Z")

</div>

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