moved error page to logging
This commit is contained in:
parent
93afc14386
commit
f8c03173cb
2 changed files with 6 additions and 4 deletions
13
internal/logging/error.go
Normal file
13
internal/logging/error.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func ErrorPage(err error, status int) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(status)
|
||||
fmt.Fprint(w, err.Error())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue