From: Brad Fitzpatrick Date: Thu, 14 Apr 2011 20:49:19 +0000 (-0700) Subject: http: be clear when failing to connect to a proxy X-Git-Tag: weekly.2011-04-27~157 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=881b1b4a025486d90a2d9caf6f7a3a7634a93c6d;p=gostls13.git 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 --- diff --git a/src/pkg/http/transport.go b/src/pkg/http/transport.go index 7fa37af3b6..d87a64613c 100644 --- a/src/pkg/http/transport.go +++ b/src/pkg/http/transport.go @@ -217,6 +217,9 @@ func (t *Transport) getConn(cm *connectMethod) (*persistConn, os.Error) { conn, err := net.Dial("tcp", cm.addr()) if err != nil { + if cm.proxyURL != nil { + err = fmt.Errorf("http: error connecting to proxy %s: %v", cm.proxyURL, err) + } return nil, err }