summaryrefslogtreecommitdiff
path: root/internal/handlers/elements.go
diff options
context:
space:
mode:
authorGrailFinder <wohilas@gmail.com>2024-05-19 07:15:20 +0300
committerGrailFinder <wohilas@gmail.com>2024-05-19 07:15:20 +0300
commit9b52a88e971e70facc74778c133244f8a93b1f31 (patch)
treecbb1b3e03130848d96b43dd6f2684ecf3f8db59e /internal/handlers/elements.go
parent2e9b18944eac3dcaf8a006594cb338d94c07a447 (diff)
Enha: avoid panic; check password at login
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)
}