1
0
mirror of https://github.com/golang/go synced 2024-11-25 05:57:57 -07:00

http: be clear when failing to connect to a proxy

Ubuntu and/or GNOME have some bug that likes
to set the "http_proxy" environment variable
and forgets to unset it.  This is annoying
to debug.  Be clear in the error message that
a proxy was in use.

R=rsc
CC=golang-dev
https://golang.org/cl/4409045
This commit is contained in:
Brad Fitzpatrick 2011-04-14 13:49:19 -07:00
parent a89c0ff39e
commit 881b1b4a02

View File

@ -217,6 +217,9 @@ func (t *Transport) getConn(cm *connectMethod) (*persistConn, os.Error) {
conn, err := net.Dial("tcp", cm.addr()) conn, err := net.Dial("tcp", cm.addr())
if err != nil { if err != nil {
if cm.proxyURL != nil {
err = fmt.Errorf("http: error connecting to proxy %s: %v", cm.proxyURL, err)
}
return nil, err return nil, err
} }