Page 1 of 1

Disable exceptions to log file

Posted: Mon Feb 08, 2010 10:19 am
by atom
Hiya

Is there a way to disable ranorex automatically writing exception details to the log file ?

Regards

Re: Disable exceptions to log file

Posted: Mon Feb 08, 2010 1:53 pm
by Support Team
atom wrote:Is there a way to disable ranorex automatically writing exception details to the log file ?
Ranorex does not automatically write exception details to the log file. However, the default code template catches all exceptions and calls Report.Error to log the exception. To disable that behavior, just comment the Report.Error lines in the exception handlers:
try
{
    //TODO: Code here - for example:
    Recording1.Start();
}
catch (RanorexException e)
{
    // comment the following two lines!
    // Report.Error(e.ToString());
    // Report.Screenshot();
    error = -1;
}
Regards,
Alex
Ranorex Support Team