WrapErr takes an existing error and adds the Caddyfile file and line number.
(err error)
| 437 | |
| 438 | // WrapErr takes an existing error and adds the Caddyfile file and line number. |
| 439 | func (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. |
no test coverage detected