Disable exceptions to log file

Ask general questions here.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Disable exceptions to log file

Post by atom » Mon Feb 08, 2010 10:19 am

Hiya

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

Regards

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Disable exceptions to log file

Post by Support Team » Mon Feb 08, 2010 1:53 pm

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
.
Image