Basically we’re using forestry.io with a client. For a specific content types we allow them to input a Vimeo URL. When the site is built we use
getJSON to pull from the Vimeo API to get video thumbnails, embed codes, ect ect.
However sometimes content editors will paste an incorrect URL Other times they might change privacy settings for the video such making a video private or giving it a private link. (This is the issue we’ve run into most often)
Whenever either of these happens getJSON no longer can fetch the url preventing builds from finishing (both production builds and the Forestry preview server).
What I’m Trying To Accomplish
I’d like it if I could create a fallback for when
getJSON fails. Then just display a simple error message in place of the video thumbnail and video player.
Is something like this possible with Hugo? I’ve searched the documentation, but couldn’t seem to find anything.