Skip to content

Commit

Permalink
tpl: Use erroridf for remote YouTube errors
Browse files Browse the repository at this point in the history
So they can be silenced.

Fixes #12383
  • Loading branch information
bep committed Apr 18, 2024
1 parent bbc6888 commit 0c188fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tpl/tplimpl/embedded/templates/shortcodes/youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/}}

{{- $pc := .Page.Site.Config.Privacy.YouTube }}
{{- $remoteErrID := "err-youtube-remote" }}
{{- if not $pc.Disable }}
{{- with $id := or (.Get "id") (.Get 0) }}

Expand All @@ -31,12 +32,12 @@
{{- $data := dict }}
{{- with resources.GetRemote $url }}
{{- with .Err }}
{{- errorf "The %q shortcode was unable to get remote resource %q. %s. See %s" $.Name $url . $.Position }}
{{- erroridf $remoteErrID "The %q shortcode was unable to get remote resource %q. %s. See %s" $.Name $url . $.Position }}
{{- else }}
{{- $data = .Content | transform.Unmarshal }}
{{- end }}
{{- else }}
{{- errorf "The %q shortcode was unable to get remote resource %q. See %s" $.Name $url $.Position }}
{{- erroridf $remoteErrID "The %q shortcode was unable to get remote resource %q. See %s" $.Name $url $.Position }}
{{- end }}

{{/* Set defaults. */}}
Expand Down

0 comments on commit 0c188fd

Please sign in to comment.