Allow getJSON errors to be ignored

This change is mostly motivated to get a more stable CI build (we're building the Hugo site there, with Instagram and Twitter shortcodes sometimes failing).

Fixes #7866
This commit is contained in:
Bjørn Erik Pedersen
2020-10-21 11:17:48 +02:00
parent 8cbe2bbfad
commit fdfa4a5fe6
52 changed files with 318 additions and 221 deletions

View File

@@ -91,7 +91,7 @@ func newPageContentOutput(p *pageState, po *pageOutput) (*pageContentOutput, err
// See https://github.com/gohugoio/hugo/issues/6210
if r := recover(); r != nil {
err = fmt.Errorf("%s", r)
p.s.Log.ERROR.Printf("[BUG] Got panic:\n%s\n%s", r, string(debug.Stack()))
p.s.Log.Errorf("[BUG] Got panic:\n%s\n%s", r, string(debug.Stack()))
}
}()
@@ -177,7 +177,7 @@ func newPageContentOutput(p *pageState, po *pageOutput) (*pageContentOutput, err
} else {
summary, content, err := splitUserDefinedSummaryAndContent(cp.p.m.markup, cp.workContent)
if err != nil {
cp.p.s.Log.ERROR.Printf("Failed to set user defined summary for page %q: %s", cp.p.pathOrTitle(), err)
cp.p.s.Log.Errorf("Failed to set user defined summary for page %q: %s", cp.p.pathOrTitle(), err)
} else {
cp.workContent = content
cp.summary = helpers.BytesToHTML(summary)