Fix render error logging

This commit is contained in:
Tim Van Baak 2025-02-07 14:16:43 -08:00
parent 9c4887c93e
commit 6b278a081c
2 changed files with 3 additions and 7 deletions

View File

@ -148,10 +148,9 @@ type LoginData struct {
Error string
}
func Login(writer io.Writer, data LoginData) error {
func Login(writer io.Writer, data LoginData) {
err := login.Execute(writer, data)
if err != nil {
log.Printf("render error: %v", err)
log.Printf("error: failed to render login: %v", err)
}
return err
}

View File

@ -5,7 +5,6 @@ import (
"database/sql"
"errors"
"fmt"
"log"
"net/http"
"time"
@ -63,9 +62,7 @@ func renderLoginWithErrorMessage(writer http.ResponseWriter, req *http.Request,
}
data := html.LoginData{Error: message}
if err := html.Login(writer, data); err != nil {
log.Printf("render error: %v", err)
}
html.Login(writer, data)
}
func (env *Env) authed(handler http.HandlerFunc) http.HandlerFunc {