Need to get the text of error

Thanks for your replies everyone. I think if I have to load log or csv then it will be better to keep it outside the macro and just use powershell to read it independently then keep on sending emails. I was thinking that there must be a way to get the exception text in a variable. I think there should be a feature request for this. Also, Yes, I completely agree that there are times when it completely stops. I understand that and handle such situation by crashing the browser every 1 hour to start fresh. If I am able to catch like even 70% of errors via email, it will serve the purpose. Thanks for your efforts everyone. Much appreciated. Its a great community. Any suggestions still welcome.

To check for errors I save a csv with steps (to understand each macro to which step it has arrived) and save also screenshots every few commands in this way I can check the errors.

I happened that ui vision via command link does not start, the macro does not start despite everything is perfectly worked, or I happened to stop without reason so I see from the csv the completed steps I understand that there was a problem, I check the screnshot and I see last state successful and I understand any problem (example site not load o load incomplete).

It can also happen that the browser no longer responds so there are so many different cases of errors that it is difficult to control them all.

Thanks for your reply. What I am going to do is to send generic email whenever an error occurs and will check by opening specific log file to see what was the error. Also, take screenshot when an error occurs. Thanks for your help so far. Much appreciated.