hugo: getJSON etc. should log ERROR but return nil in failure situations

If getJSON fails to access a URL, it fails the Hugo build, and nothing gets built at all.

It would be better if it just returned nil. The user can then throw an errorf if needed on detecting the returned value as nil.

While this recently came up again in the forum, I’ve personally witnessed this issue too.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16 (12 by maintainers)

Commits related to this issue

Most upvoted comments

nil is good, i can than output some default string or whatever fits.