feat: update some errorhandling #161

This commit is contained in:
2024-09-10 12:13:10 +02:00
parent 37c3b2a780
commit 80ab17276e
7 changed files with 99 additions and 45 deletions

View File

@@ -23,6 +23,10 @@ func HandleIndexAnd404(db *sql.DB) http.HandlerFunc {
comp = template.Layout(template.Index(), userComp)
}
comp.Render(r.Context(), w)
err := comp.Render(r.Context(), w)
if err != nil {
utils.LogError("Failed to render index", err)
http.Error(w, "Failed to render index", http.StatusInternalServerError)
}
}
}