Improve SASS errors

Fixes #9897
This commit is contained in:
Bjørn Erik Pedersen
2022-05-15 11:40:34 +02:00
parent 4b189d8fd9
commit fc9f315d86
24 changed files with 306 additions and 69 deletions

View File

@@ -554,7 +554,7 @@ func (t *templateHandler) addFileContext(templ tpl.Template, inerr error) error
}
defer f.Close()
fe := herrors.NewFileError(inErr, info.realFilename)
fe := herrors.NewFileErrorFromName(inErr, info.realFilename)
fe.UpdateContent(f, lineMatcher)
if !fe.ErrorContext().Position.IsValid() {

View File

@@ -53,7 +53,7 @@ func (t templateInfo) resolveType() templateType {
func (info templateInfo) errWithFileContext(what string, err error) error {
err = fmt.Errorf(what+": %w", err)
fe := herrors.NewFileError(err, info.realFilename)
fe := herrors.NewFileErrorFromName(err, info.realFilename)
f, err := info.fs.Open(info.filename)
if err != nil {
return err