templates/internal_error_splash.go
2025-01-12 03:47:45 -07:00

30 lines
604 B
Go

package templates
import (
"fmt"
"net/http"
)
func (T Templates) internalTemplateErrorSplash(w http.ResponseWriter, r *http.Request, e ErrorSplain) {
w.Header().Set("Content-Type", "text/html")
w.WriteHeader(e.Status)
// w.WriteHeader(http.StatusInternalServerError)
type v struct {
Title string
LoggedIn bool
Explanation string
Remediation string
}
s := v{
Title: "error",
LoggedIn: false,
Explanation: e.Explanation,
Remediation: e.Remediation,
}
err := T["error.html"].ExecuteTemplate(w, "error.html", s)
if err != nil {
fmt.Println(err)
}
return
}