From 3de81ba65c0083cf4c46c46bf0d69250031ebb5d Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Tue, 16 Nov 2021 06:24:03 +0000 Subject: [PATCH] more consistent error messages --- internal/merge.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/merge.go b/internal/merge.go index 9b5240e..c9b7431 100644 --- a/internal/merge.go +++ b/internal/merge.go @@ -69,13 +69,13 @@ func Merge(base, doc io.Reader) (merged string, assets *Assets, _ error) { func merge(base, doc *html.Node) (out *html.Node) { out, err := html.Parse(strings.NewReader("")) if err != nil { - panic("mergehtml: internal error: " + err.Error()) + panic("merge: internal error: " + err.Error()) } // TODO: title html := find(out, atom.Html) if html == nil { - log.Panicf("no in %v", out) + log.Panicf("merge: no in %v", out) } head := find(html, atom.Head) reparentChildren(head, find(find(base, atom.Html), atom.Head)) @@ -83,12 +83,12 @@ func merge(base, doc *html.Node) (out *html.Node) { body := find(html, atom.Body) if body == nil { - log.Panicf("no in %v", html) + log.Panicf("merge: no in %v", html) } baseBody := find(find(base, atom.Html), atom.Body) newBody := find(find(doc, atom.Html), atom.Body) - reparentChildren(body, baseBody) + header := findRec(body, atom.Header) footer := findRec(body, atom.Footer) main := findRec(body, atom.Main)