NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

exception information

Hello,

   When an application throws an exception, it is caught in the step.Result.Error container. But if i was to map this information back from this container back into an exception, how can i do this. The probelm is, that the Step.Result.Error.Msg contains the message and stack tarce information. I need to formalise a way of handling errors from different components of the system. Some components have an error queue so i can extract error information from that. But some components throw exceptions, and i need a way to standardise all the errors.

Please advise.

Thanks,
Regards,
Aparna

0 Kudos
Message 1 of 4
(3,591 Views)
Hi Aparna,
Your description was too vague for me to fully understand what you're ultimate objective is but hopefully this discussion will shed light. Otherwise please provide more detail.  I assume these are .NET dlls you are calling into, but what do you mean by 'formalizing a way of handling errors'?

Have a great day,
Ecleamus Ricks, Jr.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 4
(3,562 Views)
Hi Ecleamus,

    I am calling some .Net Dlls from the Teststand environment. So if an exception occurs in the dll, the Step.Runstate.Error container will capture this using the three vairables Code, Msg and Occured. But The message that is displayed in this
Step.Runstate.Error.Msg not only gives the message but also the stack trace and other information. What i would have typically liked the extract from this entire huge message is the exception.source and exception.message (like we do in c++). So what i was trying to do is.. can i map back this Step.Runstate.Error.Message back into an exception (i.e. is create a new dll that would actually process the error and give me exactly what i need) . i.e. i need to be able to use the exception class methods and properties to be able to extract only the information i need. But how do i do this from the error container?

Thanks,
Regards,
Aparna

0 Kudos
Message 3 of 4
(3,549 Views)
Hi Aparna,

You can insert a SequenceFilePostStepRuntimeError callback to handle the exceptions however you want.  This means that you can have your own code to extract the meaningful information and just store that in the Step.RunState.Error.Msg.  Refer to the TestStand manual for more information. Hope this helps.

Have a great day,

Ecleamus R.
0 Kudos
Message 4 of 4
(3,513 Views)