blob: afce9a6e38e04ebae9d7553e3ee614b7102beb35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package webui
import (
"html/template"
"net/http"
)
var errorTemplates = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/error.html"))
func errorResponse(w http.ResponseWriter, status int, err error) {
type ErrorData struct {
Page
Err error
Status int
StatusText string
}
render(w, errorTemplates, status, &ErrorData{
Page: Page{Title: "Error", Section: "error"},
Err: err,
Status: status,
StatusText: http.StatusText(status),
})
}
|