Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 07:15 UTC
caddyfile: clarify ArgErr documentation (#7960)
Signed-off-by: 0jaspahwa <ojaspahwa20@gmail.com>
0jaspahwa committed
Aug 25, 2026 at 17:24 UTC
8b62e3c60e91c00fb0e0238bb19309e0b6fad5b2
1 file changed
+5
-4
caddyconfig/caddyfile/dispenser.go
+5
-4
@@ -405,10 +405,11 @@ func (d *Dispenser) Reset() {
405
d.nesting = 0
406
}
407
408
-// ArgErr returns an argument error, meaning that another
409
-// argument was expected but not found. In other words,
410
-// a line break or open curly brace was encountered instead of
411
-// an argument.
408
+// ArgErr returns an argument error, meaning that the wrong
409
+// number of arguments was given: either a required one was
410
+// missing, or an extra one was found. If an argument is
411
+// present but its value is invalid, use Errf or SyntaxErr
412
+// instead.
413
func (d *Dispenser) ArgErr() error {
414
if isOpenCurlyBrace(d.Token()) {
415
return d.Err("unexpected token '{', expecting argument")