mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
Additional error handling in roundtripper.
This commit is contained in:
parent
7eae4ede42
commit
1d34034443
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
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)
|
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)
|
return http.DefaultClient.Do(reqProxy)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue