How do I get the Error Message in GlobalHandler, like how you use “Exception.Message” in Try Cathc?
It has one argument called in_ErrorInfo. It holds the exception message. You can print the below value in Log Message activity to display the error.
in_ErrorInfo.Exception.ToString
Is there a way to make the message shorter?
Let’s say you want to read first 50 characters from the exception message then you can try below expression.
in_ErrorInfo.Exception.ToString.Substring(0,50)
If you want to just the see Activity name which throws the exception then try below expression.
in_ErrorInfo.ActivityInfo.ToString
I found it. I’m not sure if this works in other version. But this one
errorInfo.Exception.Message
Also works in Global Handler. I was using a lower version of UiPath when I was trying to, so I tried it on a newer version.
The message helps too, but it only shows which activity gave an error.
Yes it will display error Activity name only.
If you want shorter message then you need use Substring method in error message as I mentioned in my earlier post.
The first one works too. It just that. I want to get the message like how we get it using try catch. Using ErrorInfo.Exception.Message on a higher version of UiPath worked on mine.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.