reformatted IP Ban page and shifted specific rendering to AmSendPageData

This commit is contained in:
2026-02-10 18:16:43 -07:00
parent 38c4b3f71e
commit 975265af58
5 changed files with 32 additions and 28 deletions
+2 -13
View File
@@ -57,20 +57,9 @@ func AmErrorHandler(err error, c echo.Context) {
if c.Response().Committed {
return
}
errCode := http.StatusInternalServerError
if he, ok := err.(*echo.HTTPError); ok {
errCode = he.Code
}
amctxt := ui.AmContextFromEchoContext(c)
amctxt.SetLeftMenu("top")
amctxt.SetRC(errCode)
amctxt.VarMap().Set("error", err.Error())
// TODO: come up with a way to shift templates and titles for different error codes
amctxt.VarMap().Set("amsterdam_pageTitle", "Amsterdam Internal Server Error")
cerr := ui.AmSendPageData(c, amctxt, "framed", "error.jet")
cerr := ui.AmSendPageData(c, amctxt, "error", err)
if cerr != nil {
log.Errorf("Error rendering error %d (%v): %v", errCode, err, cerr)
log.Errorf("Error rendering error (%v): %v", err, cerr)
}
}