Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCL usability: missing import gives standard error. #2696

Closed
lkarsten opened this issue Jun 4, 2018 · 3 comments
Closed

VCL usability: missing import gives standard error. #2696

lkarsten opened this issue Jun 4, 2018 · 3 comments

Comments

@lkarsten
Copy link
Contributor

lkarsten commented Jun 4, 2018

Issue: When writing VCL that is using a vmod, and the vmod isn't imported, the error message is vague.

Expected: A clear error message. This generic parse error looks the same as when you have non-breaking space, missing a closing bracket, and probably other syntax issues in your VCL. Not user friendly.

Suggested: "Are you missing an import?" or "You may need import cookie;"

$ ~/work/Varnish-Cache/bin/varnishd/varnishd -C -f `pwd`/foo.com.vcl
Message from VCC-compiler:
Expected an action, 'if', '{' or '}'
('/[[CUT]]/var/foo.com.vcl' Line 24 Pos 9)
        cookie.parse(req.http.cookie);
--------############------------------

Running VCC-compiler fail

git master.

@Dridi
Copy link
Member

Dridi commented Jun 4, 2018

You may also get this generic error message for objects, for example if you comment out a new xxx = vmod.constructor() statement and forget to comment out an xxx.call() somewhere.

@nigoroll
Copy link
Member

nigoroll commented Jun 4, 2018

I'd just add (e.g. function, method call) after "action"

@fgsch
Copy link
Member

fgsch commented Jun 4, 2018

What about prefixing it with unknown identifier "cookie" or something along those lines so it's easier to spot?

@bsdphk bsdphk closed this as completed in df1455d Aug 22, 2018
hermunn pushed a commit to hermunn/varnish-cache that referenced this issue Oct 7, 2018
Dridi pushed a commit that referenced this issue Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants