ATEasy calls .NET method which throws Exception object

Phil V.
Tucson, AZ

Aug 9, 2010
1 Post

0  |  0  

Re: ATEasy calls .NET method which throws Exception object

I am using .NET classes  as on object in ATEasy which throw an Exception object if an error occurs. These modules use the Exception class from mscorlib.

Is it possible to catch and handle the exception, so that I can read its message?

DrATEasy (Ron Y.)
Mission Viejo, CA

Aug 10, 2010
358 Posts

0  |  0  

Re: ATEasy calls .NET method which throws Exception object

You can use the ATEasy try-catch statement or you can catch the error using the module OnError. Here is the syntax for the statement (more information in the ATEasy help):

try
! .NET calls

catch else
! add you exception handling here
endtry

Trevor W.
Tucson, AZ

Feb 28, 2018
5 Posts

0  |  0  

Re: ATEasy calls .NET method which throws Exception object

The help explains how pass the error on to be handled by an outside try catch block, but it doesn't say how that outside block is supposed to capture the optional error message. I'd like to capture that error message and print it in my error block and then be able to decide how that error should be handled. Can you provide further detail on how to capture the error message so I can print it?

Solution Available
Trevor W.
Tucson, AZ

Feb 28, 2018
5 Posts

1  |  0  

Re: ATEasy calls .NET method which throws Exception object

It would appear that you can access the message by accessing the internal library Internal.GetErrorMsg() to have access to the current run-time error message.



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]