diff options
author | Emile <git@emile.space> | 2024-08-16 22:56:01 +0200 |
---|---|---|
committer | Emile <git@emile.space> | 2024-08-16 22:56:01 +0200 |
commit | 1982e06c6fd839a69576c5406ceebab966d50d2d (patch) | |
tree | 622dc99e3f450ca70964bee72f1578e0af7d3c48 /src/user.go | |
parent | 3e99a31a1f478853d8429d18945f5c0deb6a98f6 (diff) |
some better logging on template reading issues...
Diffstat (limited to 'src/user.go')
-rw-r--r-- | src/user.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/user.go b/src/user.go index f841cfa..2285394 100644 --- a/src/user.go +++ b/src/user.go @@ -266,7 +266,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) { log.Println("[d] Getting the template") t, err := template.ParseGlob(fmt.Sprintf("%s/*.html", templatesPath)) if err != nil { - log.Println("Error parsing the login template: ", err) + log.Printf("Error reading the template Path: %s/*.html", templatesPath) w.WriteHeader(http.StatusInternalServerError) w.Write([]byte("500 - Error reading template file")) http.Error(w, err.Error(), http.StatusInternalServerError) @@ -344,6 +344,7 @@ func registerHandler(w http.ResponseWriter, r *http.Request) { // get the template t, err := template.ParseGlob(fmt.Sprintf("%s/*.html", templatesPath)) if err != nil { + log.Printf("Error reading the template Path: %s/*.html", templatesPath) w.WriteHeader(http.StatusInternalServerError) w.Write([]byte("500 - Error reading template file")) http.Error(w, err.Error(), http.StatusInternalServerError) @@ -471,6 +472,7 @@ func userHandler(w http.ResponseWriter, r *http.Request) { // get the template t, err := template.ParseGlob(fmt.Sprintf("%s/*.html", templatesPath)) if err != nil { + log.Printf("Error reading the template Path: %s/*.html", templatesPath) w.WriteHeader(http.StatusInternalServerError) w.Write([]byte("500 - Error reading template file")) http.Error(w, err.Error(), http.StatusInternalServerError) @@ -515,6 +517,7 @@ func usersHandler(w http.ResponseWriter, r *http.Request) { // get the template t, err := template.ParseGlob(fmt.Sprintf("%s/*.html", templatesPath)) if err != nil { + log.Printf("Error reading the template Path: %s/*.html", templatesPath) w.WriteHeader(http.StatusInternalServerError) w.Write([]byte("500 - Error reading template file")) http.Error(w, err.Error(), http.StatusInternalServerError) @@ -591,6 +594,7 @@ func profileHandler(w http.ResponseWriter, r *http.Request) { // get the template t, err := template.ParseGlob(fmt.Sprintf("%s/*.html", templatesPath)) if err != nil { + log.Printf("Error reading the template Path: %s/*.html", templatesPath) w.WriteHeader(http.StatusInternalServerError) w.Write([]byte("500 - Error reading template file")) http.Error(w, err.Error(), http.StatusInternalServerError) |