MCPcopy
hub / github.com/caddyserver/caddy / SyntaxErr

Method SyntaxErr

caddyconfig/caddyfile/dispenser.go:417–420  ·  view source on GitHub ↗

SyntaxErr creates a generic syntax error which explains what was found and what was expected.

(expected string)

Source from the content-addressed store, hash-verified

415// SyntaxErr creates a generic syntax error which explains what was
416// found and what was expected.
417func (d *Dispenser) SyntaxErr(expected string) error {
418 msg := fmt.Sprintf("syntax error: unexpected token '%s', expecting '%s', at %s:%d import chain: ['%s']", d.Val(), expected, d.File(), d.Line(), strings.Join(d.Token().imports, "','"))
419 return errors.New(msg)
420}
421
422// EOFErr returns an error indicating that the dispenser reached
423// the end of the input when searching for the next token.

Callers 3

openCurlyBraceMethod · 0.80
closeCurlyBraceMethod · 0.80
blockTokensMethod · 0.80

Calls 4

ValMethod · 0.95
FileMethod · 0.95
LineMethod · 0.95
TokenMethod · 0.95

Tested by

no test coverage detected