Package org.evrete.api
Interface RuleBuilderExceptionHandler
public interface RuleBuilderExceptionHandler
An exception handler that is invoked for unchecked exceptions thrown by RuleSet.addRule(RuleBuilder)
The RuleSet's default exception handler simply re-throws the exception, thus breaking the whole
build process:
handler = (context, builder, exception) -> {
throw exception;
};
Custom RuleBuilderExceptionHandler implementations allow developers to optionally omit failed rules,
continue with a different RuleBuilder, or throw unchecked exception if the original (cause) exception
is deemed unrecoverable.
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(RuleSet<?> context, RuleBuilder<?> builder, RuntimeException exception)
-
Method Details
-
handle
- Parameters:
context- is either aKnowledgeor aRuleSessioninstancebuilder- rule builder that caused the exceptionexception- the exception- Throws:
RuntimeException- if developer decides that the original exception is unrecoverable and re-throws the exception (or any other instance ofRuntimeException)- See Also:
-