aboutsummaryrefslogtreecommitdiff
path: root/pkg/ext/responses.go
blob: 34e5f278bf1d8e22dc9af9a9fd2584060b81abb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package ext

import (
	"fmt"
	"net/http"

	"git.sr.ht/~gabrielgio/img/templates"
)

func NotFound(w http.ResponseWriter) {
	templates.WritePageTemplate(w, &templates.ErrorPage{
		Err: "Not Found",
	})
}

func InternalServerError(w http.ResponseWriter, err error) {
	w.WriteHeader(http.StatusInternalServerError)
	templates.WritePageTemplate(w, &templates.ErrorPage{
		Err: fmt.Sprintf("Internal Server Error:\n%s", err.Error()),
	})
}