01-19-2014 08:17 AM
Hello
I'm writing a dll in C# 2010 and i want to fill the "Details" box in the Run-Time error popup in case of an error
I fill the ErrorMessage string in Teststand but in the popup box "Run-Time Error" it says "No details available"
How can i sent the ErrorMessage string to the "Details:" box in the "Run-Time Error" popup
This is an example of my C# code
public void LABPRN_ExecuteJob(ref bool ErrorOccured, ref int ErrorCode, ref string ErrorMessage)
{
try
{
if (_sTmpFileHandle != null)
{
_sTmpFileHandle.Close();
_sTmpFileHandle.Dispose();
}
//Rename file from .tmp to .job
File.Move(sTmpPathName, _sJobPathName);
_sTmpPathName = System.String.Empty;
_sJobPathName = System.String.Empty;
}
catch (Exception ex)
{
ErrorOccured =true;
ErrorCode = -1;
ErrorMessage = ex.Message;
}
}
thanks in advance
Tonnie
01-20-2014 01:54 AM
Tonnie,
how do you call this method? To be precise: How do you pass data by TestStand?
And:
Are you sure that "ex.Message" is NOT an empty string?
Norbert
01-20-2014 02:33 AM
Hello Norbert
I have attached the step setting to this message.
ex.Message is not an empty string. I have attached a screenshot where you can see the string
Tonnie
01-20-2014 04:24 AM
Tonnie,
you are passing the wrong parameter for ErrorMessage. You have to pass "Step.Result.Error.Msg".
Norbert