# Stop an Error Message

**URL:** <https://forum.inductiveautomation.com/t/stop-an-error-message/8176>\
**Category:** Ignition\
**Created:** [March 19, 2014, 4:24pm UTC](https://forum.inductiveautomation.com/t/stop-an-error-message/8176 "2014-03-19T16:24:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AustinVDT](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@AustinVDT](https://forum.inductiveautomation.com/u/AustinVDT)\
**Post date:** [March 19, 2014, 4:24pm UTC](https://forum.inductiveautomation.com/t/stop-an-error-message/8176/1 "2014-03-19T16:24:36Z")

</div>

Hey guys,

I feel like this should be something pretty easy, but I’m not sure how to start.

In my situation, I’m using system.serial commands through an RS-485 converter to talk to 8 counters.

I’m using a system.serial.write to send a command, and system.serial.readLine to get information back from the device. It works awesome. 🙂

But, I’m foreseeing a problem. If someone were to unplug one of the counters, it would send an error message every 4 seconds (the write/reads are a timer script to refresh values). The actual error message I would get is “Underlying input stream returned 0 bytes”. The guys running this system are going to have absolutely no idea what that means. 🙂

Is there a way to stop an error message through scripting, and instead just write to a tag. The long and short of it is that I want to light up an “Error” label on the screen, rather than annoying popup error every 4 seconds with a message that makes no sense to the guys running the system

Any idea are appreciated! 🙂

Thanks!  
Austin

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [March 19, 2014, 4:33pm UTC](https://forum.inductiveautomation.com/t/stop-an-error-message/8176/2 "2014-03-19T16:33:26Z")

</div>

You could use Python’s [try…except](http://docs.python.org/2/tutorial/errors.html#handling-exceptions).

---

<div class="post-metadata">

**Author:** ![AustinVDT](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@AustinVDT](https://forum.inductiveautomation.com/u/AustinVDT)\
**Post date:** [March 19, 2014, 7:34pm UTC](https://forum.inductiveautomation.com/t/stop-an-error-message/8176/3 "2014-03-19T19:34:21Z")

</div>

That’s perfect, I looked at the try-except but it didn’t seem like it would work with the first documentation I looked at. Yours was much better, thanks!
