File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments