# Generate alarm from exception and display on Alarm Status table

**URL:** <https://forum.inductiveautomation.com/t/generate-alarm-from-exception-and-display-on-alarm-status-table/61600>\
**Category:** Ignition\
**Created:** [July 6, 2022, 11:56pm UTC](https://forum.inductiveautomation.com/t/generate-alarm-from-exception-and-display-on-alarm-status-table/61600 "2022-07-06T23:56:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![damien.tiede](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@damien.tiede](https://forum.inductiveautomation.com/u/damien.tiede)\
**Post date:** [July 6, 2022, 11:56pm UTC](https://forum.inductiveautomation.com/t/generate-alarm-from-exception-and-display-on-alarm-status-table/61600/1 "2022-07-06T23:56:07Z")

</div>

Hi All,  
I have a situation where I am getting exceptions raised by a system.tag.write operation to an OPC server on a patchy network. Rather than having this exception bubble up to the UI, I would like to catch the exception and then display it in a alarm status table.  
The alarm should automatically clear when I goes out of scope.

Can anyone advise that best way to achieve this?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![hayden](https://avatars.discourse-cdn.com/v4/letter/h/91b2a8/32.png) [@hayden](https://forum.inductiveautomation.com/u/hayden)\
**Post date:** [July 7, 2022, 5:51am UTC](https://forum.inductiveautomation.com/t/generate-alarm-from-exception-and-display-on-alarm-status-table/61600/2 "2022-07-07T05:51:14Z")

</div>

Probably easiest way is to just have in your scripting a

```auto
try:
     *Some Code*
except:
     system.tag.write("Code Fail Tag",1)

```

Just write to a memory tag and bind an alarm to that tag. Just don’t forget to reset that tag on a success or whatever.
