kenny_trytek
14 years agoOccasional Contributor
Retrieve Error Message in Keyword Test Try...Catch Block
I understand that inside scripts, exceptions can be caught using
try
{
//code here
}
catch (exception)
{ Log.Error(exception.message)}
However, because I am testing a Flex app, there are no native components throwing errors so the Debug Agent cannot tell the script that an error has occurred, even with "Advanced exception handling" enabled. Exceptions are not occurring, just object errors such as "Object Not Found".
Because of this, I had replaced the script try...catch with a keyword statement try...catch. Now the error is caught and I can insert my own error handling, but I cannot determine how to access the error message. In scripts, the catch statement takes a parameter that contains the generated exception, but there is seemingly no equivalent in the keyword catch statement.
How can I access the generated error message in the keyword catch statement?
try
{
//code here
}
catch (exception)
{ Log.Error(exception.message)}
However, because I am testing a Flex app, there are no native components throwing errors so the Debug Agent cannot tell the script that an error has occurred, even with "Advanced exception handling" enabled. Exceptions are not occurring, just object errors such as "Object Not Found".
Because of this, I had replaced the script try...catch with a keyword statement try...catch. Now the error is caught and I can insert my own error handling, but I cannot determine how to access the error message. In scripts, the catch statement takes a parameter that contains the generated exception, but there is seemingly no equivalent in the keyword catch statement.
How can I access the generated error message in the keyword catch statement?