如何使用NewSingleHostReverseProxy处理错误

I'm trying to do a load balancer to study some go packages.

I want to handle errors when the request timeout or give 404 error but can't find how to do that.

func main() {
    // start server
    http.HandleFunc("/", handleRequestAndRedirect)

    if err := http.ListenAndServe(getListenAddress(), nil); err != nil {
        panic(err)
    }
}

func handleRequestAndRedirect(res http.ResponseWriter, req *http.Request) {

    ur, _ := url.Parse("https://www.instagram.com/")
    proxy := httputil.NewSingleHostReverseProxy(ur)
    // Update the headers to allow for SSL redirection
    req.URL.Host = ur.Host
    req.URL.Scheme = ur.Scheme
    req.Header.Set("X-Forwarded-Host", req.Header.Get("Host"))
    req.Host = ur.Host
    req.Header.Set("Key", "Teste")

    proxy.ServeHTTP(res, req)

}

use proxy.ErrorHandler

ErrorHandler func(http.ResponseWriter, *http.Request, error)

  func handleRequestAndRedirect(res http.ResponseWriter, req *http.Request) {

        ur, _ := url.Parse("https://www.instagram.com/")
        proxy := httputil.NewSingleHostReverseProxy(ur)
        // Update the headers to allow for SSL redirection
        req.URL.Host = ur.Host
        req.URL.Scheme = ur.Scheme
        req.Header.Set("X-Forwarded-Host", req.Header.Get("Host"))
        req.Host = ur.Host
        req.Header.Set("Key", "Teste")

        proxy.ErrorHandler = ErrHandle
        proxy.ServeHTTP(res, req)
    }

    func ErrHandle(res http.ResponseWriter, req *http.Request, err error) {
        fmt.Println(err)
    }