Additional error handling in roundtripper.

This commit is contained in:
Daniel A. Nagy 2016-03-18 13:30:31 +01:00
parent 7eae4ede42
commit 1d34034443

View file

@ -45,6 +45,9 @@ func (self *RoundTripper) RoundTrip(req *http.Request) (resp *http.Response, err
}
url := fmt.Sprintf("http://%s:%s/%s:/%s/%s", host, self.Port, req.Proto, req.URL.Host, req.URL.Path)
glog.V(logger.Info).Infof("[BZZ] roundtripper: proxying request '%s' to '%s'", req.RequestURI, url)
reqProxy, _ := http.NewRequest(req.Method, url, req.Body)
reqProxy, err := http.NewRequest(req.Method, url, req.Body)
if err != nil {
return nil, err
}
return http.DefaultClient.Do(reqProxy)
}