summaryrefslogtreecommitdiff
path: root/internal/handlers/elements.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/elements.go')
-rw-r--r--internal/handlers/elements.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/handlers/elements.go b/internal/handlers/elements.go
index c0da7f0..62c632b 100644
--- a/internal/handlers/elements.go
+++ b/internal/handlers/elements.go
@@ -8,7 +8,8 @@ import (
func (h *Handlers) ServeShowForm(w http.ResponseWriter, r *http.Request) {
tmpl, err := template.ParseGlob("components/*.html")
if err != nil {
- panic(err)
+ abortWithError(w, err.Error())
+ return
}
tmpl.ExecuteTemplate(w, "actionform", nil)
}
@@ -16,7 +17,8 @@ func (h *Handlers) ServeShowForm(w http.ResponseWriter, r *http.Request) {
func (h *Handlers) ServeHideForm(w http.ResponseWriter, r *http.Request) {
tmpl, err := template.ParseGlob("components/*.html")
if err != nil {
- panic(err)
+ abortWithError(w, err.Error())
+ return
}
tmpl.ExecuteTemplate(w, "showformbtn", nil)
}