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

Method WrapErr

caddyconfig/caddyfile/dispenser.go:439–444  ·  caddyconfig/caddyfile/dispenser.go::Dispenser.WrapErr

WrapErr takes an existing error and adds the Caddyfile file and line number.

(err error)

Source from the content-addressed store, hash-verified

437
438// WrapErr takes an existing error and adds the Caddyfile file and line number.
439func (d *Dispenser) WrapErr(err error) error {
440 if len(d.Token().imports) > 0 {
441 return fmt.Errorf("%w, at %s:%d import chain ['%s']", err, d.File(), d.Line(), strings.Join(d.Token().imports, "','"))
442 }
443 return fmt.Errorf("%w, at %s:%d", err, d.File(), d.Line())
444}
445
446// Delete deletes the current token and returns the updated slice
447// of tokens. The cursor is not advanced to the next token.

Callers 9

ErrMethod · 0.95
ErrfMethod · 0.95
UnmarshalCaddyfileMethod · 0.80
UnmarshalCaddyfileMethod · 0.80
NativeToValueMethod · 0.80
CELMatcherDecoratorFunction · 0.80
UnmarshalCaddyfileMethod · 0.80
UnmarshalCaddyfileMethod · 0.80

Calls 3

TokenMethod · 0.95
FileMethod · 0.95
LineMethod · 0.95

Tested by

no test coverage detected