Skip to content

Commit bf643c8

Browse files
feat: More sensible name for wrap function
1 parent 21a17eb commit bf643c8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

errhandler.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import (
55
"net/http"
66
)
77

8-
// ErrHandlerFunc wraps http.HandlerFunc, allowing for errors to be handled
9-
// in a more familiar way inside your handlers.
10-
type ErrHandlerFunc func(w http.ResponseWriter, r *http.Request) error
8+
// Wrap an http.HandlerFunc, allowing for errors to be handled in a more
9+
// familiar way inside your handlers.
10+
type Wrap func(w http.ResponseWriter, r *http.Request) error
1111

1212
// ServeHTTP is invoked when the HTTP handler is called, capturing and returning
1313
// any errors encountered in the ErrHandlerFunc.
14-
func (fn ErrHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
14+
func (fn Wrap) ServeHTTP(w http.ResponseWriter, r *http.Request) {
1515
if err := fn(w, r); err != nil {
1616
http.Error(w, err.Error(), http.StatusInternalServerError)
1717
}

0 commit comments

Comments
 (0)