# Generic Python error handler?

**URL:** <https://forum.inductiveautomation.com/t/generic-python-error-handler/60584>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [June 9, 2022, 9:06pm UTC](https://forum.inductiveautomation.com/t/generic-python-error-handler/60584 "2022-06-09T21:06:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [June 9, 2022, 9:10pm UTC](https://forum.inductiveautomation.com/t/generic-python-error-handler/60584/2 "2022-06-09T21:10:57Z")

</div>

> [@Import not Work](https://forum.inductiveautomation.com/t/import-not-work/24063/2):
>
> Jython’s Exception class does not inherit from Java’s base exception class - so exceptions thrown in Java code (ie, everything written by Inductive Automation) are not caught by Exception clauses. You have to catch both possible exceptions: import java.lang.Exception try: # something something something except Exception, e: # jython exception except java.lang.Exception, e: or import java.lang.Exception try: # something something something except (Exception, java.lang.Exception),…

---

_[View the full topic](https://forum.inductiveautomation.com/t/generic-python-error-handler/60584)._
