# Modbus TCP write error

**URL:** <https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636>\
**Category:** Ignition\
**Created:** [July 13, 2020, 1:53pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636 "2020-07-13T13:53:17Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [August 28, 2020, 10:57pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/5 "2020-08-28T22:57:51Z")

</div>

Beware: jython's Exception class is not related to java.lang.Exception, so if you specify one of them, you won't catch the other. You often need two `except` clauses. Start here:

> [@Capture JythonExecException in script?](http://forum.inductiveautomation.com/t/capture-jythonexecexception-in-script/37225):
>
> I can’t seem to figure out how to capture a Jython Exception in a try…except. I have tried this format and it works for capturing database exceptions. import java.lang.Exception try: # something something something except Exception, e: # jython exception except java.lang.Exception, e: # java exception I have never been able to capture a JythonExecException. Like a divide by zero, or an exception with Sepasoft API, or an invalid reference or datatype passed into a function. Is it pos…

---

_[View the full topic](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636)._
