# Troubleshooting Client Event Scripts

**URL:** <https://forum.inductiveautomation.com/t/troubleshooting-client-event-scripts/57020>\
**Category:** General Discussion\
**Created:** [March 9, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/troubleshooting-client-event-scripts/57020 "2022-03-09T16:45:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 9, 2022, 6:29pm UTC](https://forum.inductiveautomation.com/t/troubleshooting-client-event-scripts/57020/2 "2022-03-09T18:29:39Z")

</div>

Use loggers liberally at debug level throughout the script.

> [@What is your preferred way of logging debugging info?](https://forum.inductiveautomation.com/t/what-is-your-preferred-way-of-logging-debugging-info/56404/2):
>
> I create and use loggers named by the project and script they are in, created as top-level objects. Sometimes multiple loggers in a script module if necessary. Then I log profusely at debug level. When debugging, it offers many options to selectively enable DEBUG level to narrow down the problem.

When first writing a script, I do so for 1 tag, I hard code the tagPath and/or parent paths, and other things and insure that the script works as expected. Then I move on to a list of hardcoded paths if needed, before I ever actually implement it in the gateway. Even then I still insure that I use a logger, sometimes even multiple loggers in the same script, so I can look back and get an idea of what went wrong.

> [@William\_R](#):
>
> my java exception doesn’t catch the error either.

Use multiple except blocks to ensure you catch jython exceptions as well as java exceptions.

> [@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

---

_[View the full topic](https://forum.inductiveautomation.com/t/troubleshooting-client-event-scripts/57020)._
