# Collision policy error catching on webdev

**URL:** <https://forum.inductiveautomation.com/t/collision-policy-error-catching-on-webdev/55294>\
**Category:** Ignition\
**Tags:** ignition80, ignition81\
**Created:** [January 24, 2022, 4:28am UTC](https://forum.inductiveautomation.com/t/collision-policy-error-catching-on-webdev/55294 "2022-01-24T04:28:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrishikesh.b](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@hrishikesh.b](https://forum.inductiveautomation.com/u/hrishikesh.b)\
**Post date:** [January 24, 2022, 4:28am UTC](https://forum.inductiveautomation.com/t/collision-policy-error-catching-on-webdev/55294/1 "2022-01-24T04:28:58Z")

</div>

Hello everyone,  
I’ve hit a roadblock and I need some assistance. Basically, I was writing an API for importing the tags, using the system function (system.tag.import). When I hit an API with collision policy “a”-Abort or “i”-Ignore I don’t get any error (unlike when the same task is done manually I’m getting an error message). Please help me how to trycatch this error and send it as a JSON response.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 24, 2022, 3:13pm UTC](https://forum.inductiveautomation.com/t/collision-policy-error-catching-on-webdev/55294/2 "2022-01-24T15:13:14Z")

</div>

Try adding a separate Java exception catch block:

> [@Catch IOException?](https://forum.inductiveautomation.com/t/catch-ioexception/18612/3):
>
> Consider using two except blocks, as jython’s standard Exception won’t catch pure java exceptions. Like so: import java.lang.Exception try: # something something something except Exception, e: # jython exception except java.lang.Exception, e: # java exception

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 24, 2022, 3:23pm UTC](https://forum.inductiveautomation.com/t/collision-policy-error-catching-on-webdev/55294/3 "2022-01-24T15:23:19Z")

</div>

Nowadays I recommend catching java’s `Throwable` instead of `java.lang.Exception`. Simpler import, too.
