func (s *Server) errorHandler(f func(w http.ResponseWriter, r *http.Request) error) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		if err := f(w, r); err != nil {
			s.serveError(w, r, err)
		}
	}
}
// errorHandler converts a function that returns an error into an http.HandlerFunc.
errorHandler converts a function that returns an error into an http.HandlerFunc.
// errorHandler converts a function that returns an error into an http . HandlerFunc .
func (s *Server) errorHandler(f func(w http.ResponseWriter, r *http.Request) error) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		if err := f(w, r); err != nil {
			s.serveError(w, r, err)
		}
	}
}
func ( s * Server ) errorHandler ( f func ( w http . ResponseWriter , r * http . Request ) error ) http . HandlerFunc { return func ( w http . ResponseWriter , r * http . Request ) { if err := f ( w , r ) ; err != nil { s . serveError ( w , r , err ) } } }
errorHandler converts a function that returns an error into an http.HandlerFunc.
errorHandler converts a function that returns an error into an http . HandlerFunc .