exit if unable to load template at init

This commit is contained in:
rmanach
2025-01-03 09:32:27 +01:00
parent 731f1bc5b5
commit 0d48db8b94
4 changed files with 6 additions and 30 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import (
_ "embed"
"html/template"
"mime/multipart"
"os"
"strconv"
"strings"
"sync"
@@ -40,7 +41,7 @@ var GetUploadForm = sync.OnceValue[*template.Template](func() *template.Template
tmpl, err := template.New("uploadForm").Funcs(funcMap).Parse(form)
if err != nil {
log.Err(err).Msg("unable to parse upload form")
return nil
os.Exit(1)
}
return tmpl
})