scaffolding for new seasons

This commit is contained in:
2026-02-02 19:12:14 +11:00
parent 5b4fe91c55
commit 67bf84c3a6
21 changed files with 520 additions and 41 deletions

View File

@@ -6,6 +6,7 @@ import (
"net/http"
"git.haelnorr.com/h/golib/hws"
"github.com/a-h/templ"
"github.com/pkg/errors"
)
@@ -166,3 +167,10 @@ func parseErrorDetails(details string) (int, string) {
return errDetails.Code, errDetails.Stacktrace
}
func renderSafely(page templ.Component, s *hws.Server, r *http.Request, w http.ResponseWriter) {
err := page.Render(r.Context(), w)
if err != nil {
throwInternalServiceError(s, w, r, "Failed to render page", errors.Wrap(err, "page."))
}
}