package errors import ( "net/http" "strconv" "strings" ) const template = ` TITLE

TITLE

Try reloading the page or hitting the back button. If this error persists, it seems that you may have found a bug! Please create an issue at hacdias/caddy-filemanager repository on GitHub with the code below.

CODE
` // PrintHTML prints the error page func PrintHTML(w http.ResponseWriter, code int, err error) (int, error) { tpl := template tpl = strings.Replace(tpl, "TITLE", strconv.Itoa(code)+" "+http.StatusText(code), -1) tpl = strings.Replace(tpl, "CODE", err.Error(), -1) _, err = w.Write([]byte(tpl)) if err != nil { return http.StatusInternalServerError, err } return http.StatusOK, nil }