func()

in view/error.go [47:68]


func (err errorCodeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	code := err.err.Code()
	if code == 0 {
		code = http.StatusInternalServerError
	}
	if usePlainText(r) {
		w.Header().Set("Content-Type", "text/plain; charset=utf-8")
		w.WriteHeader(code)
		io.Copy(w, strings.NewReader(err.err.Error()))
		w.Write([]byte("\n"))
	} else {
		w.Header().Set("Content-Type", "text/html; charset=utf-8")
		w.WriteHeader(code)
		page := &Page{
			Body: h.Frag{
				h.String(err.err.Error()),
				&h.Script{Inner: h.Unsafe("window.location.hash = ''")},
			},
		}
		h.Write(context.TODO(), w, page)
	}
}