Skip to content

EnableExceptionAsErrorMessage = false does not actually throw exception, but ignores/supresses it #624

@rklec

Description

@rklec

STR

Have any invalid rule or one that somehow else throws an exception.

And have the settings configured as such:

      var engineSettings = new ReSettings()
        {
            CustomActions = // ...
            CustomTypes = // ...
            EnableExceptionAsErrorMessage = false
        };
     
        new RulesEngine.RulesEngine(mailWorkflows, engineSettings);     

What should happen

EnableExceptionAsErrorMessage = false is explained on https://microsoft.github.io/RulesEngine/#settings should do the following:

Otherwise [= if false], throws an exception. This setting is only applicable if IgnoreException is set to false.

Notably IgnoreException is not touched, i.e. it is (as per https://microsoft.github.io/RulesEngine/#settings aka the default set to false)

What happens

Errors are silently ignored.

More information

I have also indicated this in #623, see this for a practical example.

System

    <TargetFramework>net8.0</TargetFramework>
<!-- ... -->
    <PackageReference Include="RulesEngine" Version="5.0.3" /> 

aka .NET 8

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions