fix(kroki): update error handling pattern for newer Hugo

This commit is contained in:
Amolith 2025-06-03 14:33:09 -06:00
parent 425a5d53ad
commit 0ea4e84975
Signed by: Amolith
SSH Key Fingerprint: SHA256:JBKEeoO/72Fz03rtlzeO49PATFT2maMancH3opcT0h0
1 changed files with 4 additions and 4 deletions

View File

@ -91,14 +91,14 @@ References:
{{- /* Get diagram. */}} {{- /* Get diagram. */}}
{{- $body := dict "diagram_source" $inner "diagram_type" $diagramType "output_format" "SVG" "diagram_options" $diagram_opts | jsonify }} {{- $body := dict "diagram_source" $inner "diagram_type" $diagramType "output_format" "SVG" "diagram_options" $diagram_opts | jsonify }}
{{- $opts := dict "method" "post" "body" $body }} {{- $opts := dict "method" "post" "body" $body }}
{{- with resources.GetRemote $apiEndpoint $opts }} {{- with try (resources.GetRemote $apiEndpoint $opts) }}
{{- with .Err }} {{- with .Err }}
{{- errorf "The %q code block render hook was unable to get the remote diagram. See %s. %s" $renderHookName $position . }} {{- errorf "The %q code block render hook was unable to get the remote diagram. See %s. %s" $renderHookName $position . }}
{{- else }} {{- else with .Value }}
{{- $attrs = merge $attrs (dict "src" .RelPermalink) }} {{- $attrs = merge $attrs (dict "src" .RelPermalink) }}
{{- else }}
{{- errorf "The %q code block render hook was unable to get the remote diagram. See %s" $renderHookName $position }}
{{- end }} {{- end }}
{{- else }}
{{- errorf "The %q code block render hook was unable to get the remote diagram. See %s" $renderHookName $position }}
{{- end }} {{- end }}
{{- /* Render. */}} {{- /* Render. */}}