exit if unable to load template at init
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user