You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
In some cases ln_loadSamples() returns zero (success) even though the loading of the rulebase failed and an error message was logged through liblognorm error logging callback method.
If the broken rulebase is then used for normalization the ln_normalize() method also returns zero (success), but instead of generating a successfully normalized message the method generates json that contains further error details in normalized form.
The error message logged by the callback method must be used to trigger an exception in the java code, preventing the usage of broken rulebase for normalization.
An example rulebase that is missing version=2 line from the beginning, which will trigger the error:
By encapsulating ErrorCallbackImpl inside the java class that is interacting with the liblognorm library through JNA, it is possible to keep track of errors occurring inside liblognorm library for java exception handling.
Version 2 rulebase also behaves similarly like version 1 rulebase, the ln_loadSamples() method does not return error codes when there is an invalid rule included in the rulebase. The method does still generate error messages through the error callback, which will allow catching the errors as exceptions in java.
Description
In some cases ln_loadSamples() returns zero (success) even though the loading of the rulebase failed and an error message was logged through liblognorm error logging callback method.
If the broken rulebase is then used for normalization the ln_normalize() method also returns zero (success), but instead of generating a successfully normalized message the method generates json that contains further error details in normalized form.
The error message logged by the callback method must be used to trigger an exception in the java code, preventing the usage of broken rulebase for normalization.
An example rulebase that is missing
version=2
line from the beginning, which will trigger the error:The text was updated successfully, but these errors were encountered: