Replies: 2 comments 2 replies
-
I think this is going to come down to an issue with some unsafe interface conversions in the parser. I've managed to fix your example but am currently looking for other instances where this might pop up. |
Beta Was this translation helpful? Give feedback.
2 replies
-
checkout latest release, v1.10.0 , the parser been hardened, you won't get a panic from parser anymore. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm in the process of building a web interface for our team to add/modify/delete rule files on a remote server. The interface allows for a simple "syntax check" for a rule prior to testing the rule. I am using the "BuildRuleFromResource" function from the rule builder which is supposed to return any errors that occur. It is not consistent on when errors are returned as expected or when a low level function "panics". When the panic occurs the errors are caught as expected and logged out from the running process, but the errors are not returned by the function and I am unable to send the actual syntax error messages back to the user on the web interface.
The panic shows interface errors. I have created a very minimal example of code that demonstrates the panic errors. Here is the sample code:
You can see that I intentionally inserted a "<" in the when clause of the rule to force a syntax error. When I run the test I get the following:
It makes a difference where the syntax errors occur on whether the error messages will be successfully returned as expected by the "BuildRuleFromResource" function. Syntax errors in some locations within the rule return the errors and some do not.
Here are the associated panic messages I have encountered while testing that indicate the missing interface functions:
It appears that some low level structures do not provide all the required functions that they should have to fulfill interface requirements.
FYI: Running GO 1.14 on MacOS
Beta Was this translation helpful? Give feedback.
All reactions