From 9015baf955c94a806c01b3dcd5648c8e68ad2685 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 12 Mar 2025 22:39:51 +0100 Subject: refactor: ensure errors have stack traces --- internal/components/markdown.templ | 4 ++-- internal/components/page.templ | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/components') diff --git a/internal/components/markdown.templ b/internal/components/markdown.templ index ff1212f..0ce98ad 100644 --- a/internal/components/markdown.templ +++ b/internal/components/markdown.templ @@ -5,9 +5,9 @@ import ( "go.alanpearce.eu/searchix/internal/nix" + "context" "github.com/yuin/goldmark" "github.com/yuin/goldmark/extension" - "context" "io" ) @@ -27,7 +27,7 @@ func firstSentence[T ~string](text T) T { } func markdown(text nix.Markdown) templ.Component { - return templ.ComponentFunc(func(ctx context.Context, w io.Writer) error { + return templ.ComponentFunc(func(ctx context.Context, w io.Writer) errors.E { err := md.Convert([]byte(text), w) return err diff --git a/internal/components/page.templ b/internal/components/page.templ index 4ba3741..63d0439 100644 --- a/internal/components/page.templ +++ b/internal/components/page.templ @@ -81,7 +81,7 @@ templ script(s *frontend.Asset) { } func Unsafe(html string) templ.Component { - return templ.ComponentFunc(func(_ context.Context, w io.Writer) (err error) { + return templ.ComponentFunc(func(_ context.Context, w io.Writer) (err errors.E) { _, err = io.WriteString(w, html) return }) -- cgit 1.4.1