# Retrieve the error message occurred due to action performed

**URL:** <https://forum.inductiveautomation.com/t/retrieve-the-error-message-occurred-due-to-action-performed/82571>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 1, 2023, 6:12am UTC](https://forum.inductiveautomation.com/t/retrieve-the-error-message-occurred-due-to-action-performed/82571 "2023-12-01T06:12:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_ANIL\_KUMAR](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@S\_ANIL\_KUMAR](https://forum.inductiveautomation.com/u/S_ANIL_KUMAR)\
**Post date:** [December 1, 2023, 6:12am UTC](https://forum.inductiveautomation.com/t/retrieve-the-error-message-occurred-due-to-action-performed/82571/1 "2023-12-01T06:12:58Z")

</div>

Hi,  
I have a requirement to retrieve the error message occurred and send an email to the developers. I can achieve this using the traceback module. where as I didn't find a way to retrieve the exact message that displays in the error message dialog box of perspective.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/441e8b03f23266a0807cffe27578092382627162.png)

I am keeping this message that's being displayed above as the subject of the email body and the details as the body of the email. I am wanting to retrieve the component path from where the error occurred and why( was it due to action performer /value changed and it's path ) .  
Could anyone suggest if there is any way to retrieve this message in perspective.

Thanks

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [December 1, 2023, 8:06am UTC](https://forum.inductiveautomation.com/t/retrieve-the-error-message-occurred-due-to-action-performed/82571/2 "2023-12-01T08:06:45Z")

</div>

Sounds like you just want to capture the errors in your code. I normally output these to the loggers using `system.util.getLogger(....)`  
But you could do the same with sending emails.

In your code you could have some kind of `Try except` and get the error message and send the email off.

Something like:

```auto
from java.lang import Throwable

try:
     Your_action()
except Exception as e:
     #Pythonic error
     error = e
     system.net.sendEmail(......
except Throwable as e:
     #Java based error
     error = e
     system.net.sendEmail(......

```

---

<div class="post-metadata">

**Author:** ![S\_ANIL\_KUMAR](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@S\_ANIL\_KUMAR](https://forum.inductiveautomation.com/u/S_ANIL_KUMAR)\
**Post date:** [December 1, 2023, 8:20am UTC](https://forum.inductiveautomation.com/t/retrieve-the-error-message-occurred-due-to-action-performed/82571/3 "2023-12-01T08:20:52Z")

</div>

Thanks @Hayden_Watson , I am able to get the error that occurred in my code. Where as what I am trying to retrieve is the on what action the error occurred and component name , as in the above screenshot the message states " component action performed' on the ticketUI/ test Errror@D/root/button'.
