Skip to content

Unclear error message when calling non-existent function due to case-sensitive typo #43

@datasc31

Description

@datasc31

Background
When using the online WPL editor, calling a function with a case-sensitive typo (for example, json_unEscape instead of json_unescape) results in a low-level syntax error message. The error does not clearly indicate that the root cause is an unknown or mis-cased function name.

This behavior is confusing for first-time or trial users, as the error appears to be a grammar or pipeline syntax issue rather than a function resolution problem.

Steps to Reproduce

  1. Open the online WPL editor.

  2. Use the following rule snippet:

    json | take(log) | json_unEscape() | (
    ip: sip,
    2*_,
    time: recv_time<[, ]>,
    http/request",
    http/status,
    digit,
    chars",
    http/agent",
    _
    )

  3. Click the “Parse” button.

Actual Result
The editor reports a generic syntax error:

WPL parse failed: [500] syntax error > parse error at line 4, column 18
invalid symbol
expected ,, next field, ( ... ), group '( ... )' content, group, , rule <name> { ... }, { rule ... }
Error Code: WPL_PARSE_ERROR

The error message does not indicate that json_unEscape is an invalid or unknown function name.

Image

Expected Result
The error message should clearly indicate that the function name is invalid. Ideally, the editor should:

  • Point out the exact invalid function name (json_unEscape)

  • Mention that function names are case-sensitive

  • Suggest the correct function name if possible, for example:

    Unknown function json_unEscape.
    Did you mean json_unescape?

Impact
Users may mistakenly assume there is a grammar or syntax problem and spend time debugging unrelated parts of the rule. This increases trial-and-error cost and negatively affects the initial learning and trial experience.

Suggested Improvement

  • Distinguish unknown function names from generic syntax errors.
  • When parsing fails at a function call position, validate the function name against the known function registry.
  • Provide targeted error messages for unknown or mis-cased function names.
  • Optionally offer “Did you mean …” suggestions using case-insensitive matching.

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