You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: handler.go
    path of file: ./repos/corteza/server/vendor/github.com/crewjam/httperr
    
    the code of the file until where you have to start completion: package httperr

import "net/http"

// The HandlerFunc type is an adapter to allow the use of
// ordinary functions as HTTP handlers.  If f is a function
// with the appropriate signature, Handle
    
func (f HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	if err := f(w, r); err != nil {
		if v := r.Context().Value(onErrorIndex); v != nil {
			v.(func(error))(err)
		} else {
			Write(w, r, err)
		}
	}
}