Skip to content

Commit b6c8dfa

Browse files
authored
tpl/tplimpl: Change resources.GetRemote errors to suppressible warnings
Closes #13803
1 parent 621ea42 commit b6c8dfa

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

tpl/tplimpl/embedded/templates/_shortcodes/twitter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
2121
{{- with try (resources.GetRemote $request) -}}
2222
{{- with .Err -}}
23-
{{- errorf "%s" . -}}
23+
{{- warnidf "shortcode-twitter-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
2424
{{- else with .Value -}}
2525
{{- (. | transform.Unmarshal).html | safeHTML -}}
2626
{{- else -}}

tpl/tplimpl/embedded/templates/_shortcodes/twitter_simple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
1717
{{- with try (resources.GetRemote $request) -}}
1818
{{- with .Err -}}
19-
{{- errorf "%s" . -}}
19+
{{- warnidf "shortcode-twitter-simple-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
2020
{{- else with .Value -}}
2121
{{- if not site.Config.Services.Twitter.DisableInlineCSS }}
2222
{{- template "__h_simple_twitter_css" (dict "ctx" $.ctx) }}

tpl/tplimpl/embedded/templates/_shortcodes/vimeo_simple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{{- $request := printf "https://vimeo.com/api/oembed.json?%s" $query -}}
2626
{{- with try (resources.GetRemote $request) -}}
2727
{{- with .Err -}}
28-
{{- errorf "%s" . -}}
28+
{{- warnidf "shortcode-vimeo-simple" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
2929
{{- else with .Value -}}
3030
{{- with . | transform.Unmarshal -}}
3131
{{- $class := printf "%s %s" "s_video_simple" "__h_video" -}}

tpl/tplimpl/embedded/templates/_shortcodes/x.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
2020
{{- with try (resources.GetRemote $request) -}}
2121
{{- with .Err -}}
22-
{{- errorf "%s" . -}}
22+
{{- warnidf "shortcode-x-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
2323
{{- else with .Value -}}
2424
{{- (. | transform.Unmarshal).html | safeHTML -}}
2525
{{- else -}}

tpl/tplimpl/embedded/templates/_shortcodes/x_simple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
1616
{{- with try (resources.GetRemote $request) -}}
1717
{{- with .Err -}}
18-
{{- errorf "%s" . -}}
18+
{{- warnidf "shortcode-x-simple-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
1919
{{- else with .Value -}}
2020
{{- if not site.Config.Services.X.DisableInlineCSS }}
2121
{{- template "__h_simple_x_css" (dict "ctx" $.ctx) }}

0 commit comments

Comments
 (0)