From b6c8dfa9dc4e446bae7d50088fb568939f6ccd4a Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Tue, 17 Jun 2025 07:35:14 -0700 Subject: [PATCH] tpl/tplimpl: Change resources.GetRemote errors to suppressible warnings Closes #13803 --- tpl/tplimpl/embedded/templates/_shortcodes/twitter.html | 2 +- tpl/tplimpl/embedded/templates/_shortcodes/twitter_simple.html | 2 +- tpl/tplimpl/embedded/templates/_shortcodes/vimeo_simple.html | 2 +- tpl/tplimpl/embedded/templates/_shortcodes/x.html | 2 +- tpl/tplimpl/embedded/templates/_shortcodes/x_simple.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html b/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html index 849bad99e..c6200ffd2 100644 --- a/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html +++ b/tpl/tplimpl/embedded/templates/_shortcodes/twitter.html @@ -20,7 +20,7 @@ {{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}} {{- with try (resources.GetRemote $request) -}} {{- with .Err -}} - {{- errorf "%s" . -}} + {{- warnidf "shortcode-twitter-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}} {{- else with .Value -}} {{- (. | transform.Unmarshal).html | safeHTML -}} {{- else -}} diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/twitter_simple.html b/tpl/tplimpl/embedded/templates/_shortcodes/twitter_simple.html index e9dcc76ba..34150393d 100644 --- a/tpl/tplimpl/embedded/templates/_shortcodes/twitter_simple.html +++ b/tpl/tplimpl/embedded/templates/_shortcodes/twitter_simple.html @@ -16,7 +16,7 @@ {{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}} {{- with try (resources.GetRemote $request) -}} {{- with .Err -}} - {{- errorf "%s" . -}} + {{- warnidf "shortcode-twitter-simple-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}} {{- else with .Value -}} {{- if not site.Config.Services.Twitter.DisableInlineCSS }} {{- template "__h_simple_twitter_css" (dict "ctx" $.ctx) }} diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/vimeo_simple.html b/tpl/tplimpl/embedded/templates/_shortcodes/vimeo_simple.html index 2e5f88282..a00f3e7f6 100644 --- a/tpl/tplimpl/embedded/templates/_shortcodes/vimeo_simple.html +++ b/tpl/tplimpl/embedded/templates/_shortcodes/vimeo_simple.html @@ -25,7 +25,7 @@ {{- $request := printf "https://vimeo.com/api/oembed.json?%s" $query -}} {{- with try (resources.GetRemote $request) -}} {{- with .Err -}} - {{- errorf "%s" . -}} + {{- warnidf "shortcode-vimeo-simple" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}} {{- else with .Value -}} {{- with . | transform.Unmarshal -}} {{- $class := printf "%s %s" "s_video_simple" "__h_video" -}} diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/x.html b/tpl/tplimpl/embedded/templates/_shortcodes/x.html index 87455530c..38bf0f7b6 100644 --- a/tpl/tplimpl/embedded/templates/_shortcodes/x.html +++ b/tpl/tplimpl/embedded/templates/_shortcodes/x.html @@ -19,7 +19,7 @@ {{- $request := printf "https://publish.x.com/oembed?%s" $query -}} {{- with try (resources.GetRemote $request) -}} {{- with .Err -}} - {{- errorf "%s" . -}} + {{- warnidf "shortcode-x-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}} {{- else with .Value -}} {{- (. | transform.Unmarshal).html | safeHTML -}} {{- else -}} diff --git a/tpl/tplimpl/embedded/templates/_shortcodes/x_simple.html b/tpl/tplimpl/embedded/templates/_shortcodes/x_simple.html index be7830668..1e22835f6 100644 --- a/tpl/tplimpl/embedded/templates/_shortcodes/x_simple.html +++ b/tpl/tplimpl/embedded/templates/_shortcodes/x_simple.html @@ -15,7 +15,7 @@ {{- $request := printf "https://publish.x.com/oembed?%s" $query -}} {{- with try (resources.GetRemote $request) -}} {{- with .Err -}} - {{- errorf "%s" . -}} + {{- warnidf "shortcode-x-simple-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}} {{- else with .Value -}} {{- if not site.Config.Services.X.DisableInlineCSS }} {{- template "__h_simple_x_css" (dict "ctx" $.ctx) }}