Alarm when a Script fails

Hello Ignition Forum.

I would like to know if there exists a way to alarm when a Script fails. I know I can see the status in the Gateway Scripts section but is there a way to know it and send an alarm or something.

Thank you for your help.

What determines if a script fails?