diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-15 11:40:34 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-15 20:25:25 +0200 |
commit | fc9f315d86e1fe51c3d1eec3b60680113b2e3aa6 (patch) | |
tree | 69e8ffc4d84e8f02e0e6f098c27cda9dd3bcc544 /hugolib | |
parent | 4b189d8fd93d3fa326b31d451d5594c917e6c714 (diff) |
Improve SASS errors
Fixes #9897
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/integrationtest_builder.go | 3 | ||||
-rw-r--r-- | hugolib/page.go | 2 | ||||
-rw-r--r-- | hugolib/shortcode.go | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go index c3fb9fffc..0ec202f89 100644 --- a/hugolib/integrationtest_builder.go +++ b/hugolib/integrationtest_builder.go @@ -168,8 +168,9 @@ func (s *IntegrationTestBuilder) destinationExists(filename string) bool { return b } -func (s *IntegrationTestBuilder) AssertIsFileError(err error) { +func (s *IntegrationTestBuilder) AssertIsFileError(err error) herrors.FileError { s.Assert(err, qt.ErrorAs, new(herrors.FileError)) + return herrors.UnwrapFileError(err) } func (s *IntegrationTestBuilder) AssertRenderCountContent(count int) { diff --git a/hugolib/page.go b/hugolib/page.go index e6dd8fc2e..19d969532 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -788,7 +788,7 @@ func (p *pageState) outputFormat() (f output.Format) { func (p *pageState) parseError(err error, input []byte, offset int) error { pos := p.posFromInput(input, offset) - return herrors.NewFileError(err, p.File().Filename()).UpdatePosition(pos) + return herrors.NewFileErrorFromName(err, p.File().Filename()).UpdatePosition(pos) } func (p *pageState) pathOrTitle() string { diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 41121700d..45d5f1ca8 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -298,7 +298,7 @@ func renderShortcode( var err error tmpl, err = s.TextTmpl().Parse(templName, templStr) if err != nil { - fe := herrors.NewFileError(err, p.File().Filename()) + fe := herrors.NewFileErrorFromName(err, p.File().Filename()) pos := fe.Position() pos.LineNumber += p.posOffset(sc.pos).LineNumber fe = fe.UpdatePosition(pos) @@ -391,7 +391,7 @@ func renderShortcode( result, err := renderShortcodeWithPage(s.Tmpl(), tmpl, data) if err != nil && sc.isInline { - fe := herrors.NewFileError(err, p.File().Filename()) + fe := herrors.NewFileErrorFromName(err, p.File().Filename()) pos := fe.Position() pos.LineNumber += p.posOffset(sc.pos).LineNumber fe = fe.UpdatePosition(pos) |