pcmt/handlers/error.go
leo 847d4aab22
All checks were successful
continuous-integration/drone/push Build is passing
handlers: rename helper.go -> error.go
2023-05-11 04:54:31 +02:00

28 lines
525 B
Go

package handlers
import (
"fmt"
"strconv"
"github.com/labstack/echo/v4"
)
func renderErrorPage(c echo.Context, status int, statusText, error string) error {
strStatus := strconv.Itoa(status)
return c.Render(
status,
"errorPage.tmpl",
page{
AppName: setting.AppName(),
AppVer: appver,
Title: fmt.Sprintf("Error %s - %s", strStatus, statusText),
DevelMode: setting.IsDevel(),
Current: strStatus,
Error: error,
Status: strStatus,
StatusText: statusText,
},
)
}