leo
c4d0cb209b
All checks were successful
continuous-integration/drone/push Build is passing
* let the settings struct be the single source of truth * rm app fields that are covered by settings * pass around a pointer to settings instead of config * consolidate config+flags into settings on start-up * update tests * rm empty settings.go file fixes #4
31 lines
553 B
Go
31 lines
553 B
Go
package handlers
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
)
|
|
|
|
func renderErrorPage(wr io.Writer, status int, statusText, error string) error {
|
|
tpl := getTmpl("errorPage.tmpl")
|
|
strStatus := strconv.Itoa(status)
|
|
|
|
err := tpl.Execute(wr,
|
|
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,
|
|
},
|
|
)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|