adding smarter error recovery and reformatted the unjoin page

This commit is contained in:
2026-02-10 22:32:18 -07:00
parent 611881b7dc
commit 0e5a4bc5a3
5 changed files with 79 additions and 33 deletions
+6
View File
@@ -70,6 +70,9 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an
}
amctxt.SetFrameTitle("Internal Server Error")
amctxt.VarMap().Set("error", message)
if tmp := amctxt.GetSession("lastKnownGood"); tmp != nil {
amctxt.VarMap().Set("recovery", tmp)
}
command = "framed"
data = "error.jet"
case "ipban":
@@ -148,6 +151,9 @@ func AmWrap(myfunc PageFunc) echo.HandlerFunc {
// Exec the wrapped function.
command, arg := myfunc(ctxt)
if command != "error" && command != "ipban" {
ctxt.SetSession("lastKnownGood", ctxt.Locator())
}
if err := ctxt.SaveSession(); err != nil {
c.Logger().Errorf("Session save error: %v", err)
return err