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

@@ -38,7 +38,7 @@ type FrontMatterHandler struct {
// A map of all date keys configured, including any custom.
allDateKeys map[string]bool
logger *loggers.Logger
logger loggers.Logger
}
// FrontMatterDescriptor describes how to handle front matter for a given Page.
@@ -148,7 +148,7 @@ func (f FrontMatterHandler) newChainedFrontMatterFieldHandler(handlers ...frontM
// First successful handler wins.
success, err := h(d)
if err != nil {
f.logger.ERROR.Println(err)
f.logger.Errorln(err)
} else if success {
return true, nil
}
@@ -262,7 +262,7 @@ func toLowerSlice(in interface{}) []string {
// NewFrontmatterHandler creates a new FrontMatterHandler with the given logger and configuration.
// If no logger is provided, one will be created.
func NewFrontmatterHandler(logger *loggers.Logger, cfg config.Provider) (FrontMatterHandler, error) {
func NewFrontmatterHandler(logger loggers.Logger, cfg config.Provider) (FrontMatterHandler, error) {
if logger == nil {
logger = loggers.NewErrorLogger()