From 6a468cd71867be37c252b0c8680d5f919cb360b7 Mon Sep 17 00:00:00 2001 From: RochoElLocho Date: Sun, 12 Jan 2025 12:39:09 +0100 Subject: [PATCH] Debuggen eines fehlers --- main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f234c5c..9f890c2 100644 --- a/main.go +++ b/main.go @@ -76,9 +76,15 @@ func handleFavicon(w http.ResponseWriter, r *http.Request) { } func handlePopupInstructions(w http.ResponseWriter, r *http.Request) { - tmpl := template.Must(template.ParseFiles("popup.html")) + tmpl, err := template.ParseFiles("popup.html") + if err != nil { + log.Printf("Fehler beim Parsen des Templates: %v", err) + http.Error(w, "Interner Serverfehler", http.StatusInternalServerError) + return + } if err := tmpl.Execute(w, nil); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + log.Printf("Fehler beim Ausführen des Templates: %v", err) + http.Error(w, "Interner Serverfehler", http.StatusInternalServerError) } }