mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
@@ -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) {
|
||||
|
@@ -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 {
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user