Verbessere Fehlerbehandlung

This commit is contained in:
Gonne 2022-09-26 12:42:08 +02:00
parent f04396809d
commit 9357ab1520
2 changed files with 5 additions and 7 deletions

View file

@ -10,14 +10,14 @@ func (b *BaseHandler) ConfirmRequestHandler(w http.ResponseWriter, req *http.Req
request, err := b.requestRepo.FindBySecret(secret)
if err != nil {
// TODO: header 404
w.WriteHeader(http.StatusNotFound)
templating.ServeTemplate(w, "requestNotFound", nil)
return
}
err = b.requestRepo.Execute(request)
if err != nil {
// TODO: write header 500
w.WriteHeader(http.StatusInternalServerError)
templating.ServeTemplate(w, "executeFailure", err.Error())
return
}