# Tag value changed event script only shows error in the gateway logs once

**URL:** <https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804>\
**Category:** Ignition\
**Created:** [July 13, 2021, 11:14pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804 "2021-07-13T23:14:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandler](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@chandler](https://forum.inductiveautomation.com/u/chandler)\
**Post date:** [July 13, 2021, 11:14pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/1 "2021-07-13T23:14:21Z")

</div>

Hello all,

I have noticed that when a tag value changed event script throws an error it is only logged in the gateway logs a single time. When the script runs again and throws the same error, it doesn’t show in the logs. I find this to be frustrating because if I don’t notice the error the first time it happens it is easy to miss any subsequent script failures when looking over the logs.

To (hopefully) recreate this I created a boolean memory tag, and a integer memory tag and put the following script on the boolean tag’s value changed event:

```auto
	if not initialChange:
			
		i = system.tag.readBlocking(['[default]testInt'])[0].value
		system.tag.writeBlocking(['[default]testInt'], [i + 1])
		
		j = None
		
		j.thisDoesntExist = 1

```

When I run the script the first time, it increments the integer tag, then throws an AttributeError as you would expect. Then when I run the script again, it increments the integer tag, but does not throw the error again. Because the integer value was incremented I know the script ran, but it does not throw the error even though I would imagine the same exception was thrown.

The only way that I can find to get the script to throw the error again is to make a change to the script (even if it is just added a new line to the beginning of the code) and commit it before running the script again.

Does anyone know if this is intended behavior, or just a bug?

Thanks,  
Chandler

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2021, 11:19pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/2 "2021-07-13T23:19:03Z")

</div>

It’s intended, the script is flagged with an error status and the log message is not repeated on subsequent executions.

The alternative is our support department receiving useless logs filled with repeated tag change errors that might not even be relevant to the issue they are troubleshooting…

If the logger for `tags.eventscripts.dispatcher` is put on DEBUG level then repeated errors will be logged as well.

---

<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:** [July 13, 2021, 11:19pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/3 "2021-07-13T23:19:44Z")

</div>

There’s usually a message with the original error saying that further occurences will be suppressed.

---

<div class="post-metadata">

**Author:** ![chandler](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@chandler](https://forum.inductiveautomation.com/u/chandler)\
**Post date:** [July 13, 2021, 11:29pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/4 "2021-07-13T23:29:01Z")

</div>

That makes sense. I will just turn my logger level up, since I would rather see the errors so I can go fix the problem, rather than miss it and forget for weeks.

Thanks for the speedy response!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2021, 11:30pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/5 "2021-07-13T23:30:19Z")

</div>

I think DEBUG level might result in some other messages being logged as well… and it won’t persist across gateway restarts.

---

<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:** [July 13, 2021, 11:43pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/6 "2021-07-13T23:43:41Z")

</div>

You can also use a `try:` … `except:` block to handle them yourself.

---

<div class="post-metadata">

**Author:** ![chandler](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@chandler](https://forum.inductiveautomation.com/u/chandler)\
**Post date:** [July 14, 2021, 3:10pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/7 "2021-07-14T15:10:08Z")

</div>

Is there a way to see if a script has been flagged with an error status?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 14, 2021, 3:11pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-event-script-only-shows-error-in-the-gateway-logs-once/48804/8 "2021-07-14T15:11:10Z")

</div>

The diagnostics on that tag should indicate some kind of error.
