ILOG Rules for .NET User Guides > Rule Studio > Executing Rules > Setting an Exception Handler on the Engine Execution

To set an exception handler, see the UserRuntimeException Class.

The following exception is thrown at runtime when a user's methods or constructors throw exceptions.

try
{
    engine.Execute();
}
catch (UserRuntimeException e) {                
    if (e.IsInActions()) {
        Console.WriteLine("An exception was thrown in the action part 
                           of a rule: " + e.Message);
    }
    else if (e.IsInConditions())
    {
        Console.WriteLine("An exception was thrown in the condition part
                           of a rule: " + e.Message);
    } 
}

See Also

Retrieving Data and Events From the Engine | Retrieving Data and Events From the Engine