I want to get the selector error as an email

After getting an error, I let the bot take a screenshot and send it as an email along with the error → ‘exception.message’

However returns this Could not find the UI element corresponding to this selector: [1] [2] Search failed at selector tag: [2] The closest matches found are: [72%] [72%] [66%] [66%] [59%] [59%] [59%] [59%] [58%] [58%]

but what i want is the target selector it couldnt find
example:

Test to uncheck the IsBodyHtml option.

image

If you want to use HTML you will need to format the error message first:

"<pre>" + System.Net.WebUtility.HtmlEncode(exception.Message) + "</prev"

instead of
exception.Message

try

exception.InnerException.Message

or

exception.toString