Skip to content

Commit 179cc7c

Browse files
committed
fmt.Errorf --> errors.Newf
1 parent 80f788d commit 179cc7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/api/proxy.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import (
55
"context"
66
"crypto/tls"
77
"encoding/base64"
8-
"fmt"
98
"io"
109
"net"
1110
"net/http"
1211
"net/url"
1312
"sync"
13+
14+
"github.com/sourcegraph/sourcegraph/lib/errors"
1415
)
1516

1617
type connWithBufferedReader struct {
@@ -156,7 +157,7 @@ func withProxyTransport(baseTransport *http.Transport, proxyURL *url.URL, proxyP
156157
b, _ := io.ReadAll(io.LimitReader(resp.Body, 4<<10))
157158
resp.Body.Close()
158159
conn.Close()
159-
return nil, fmt.Errorf("failed to connect to proxy %s: %s: %q", proxyURL.Redacted(), resp.Status, b)
160+
return nil, errors.Newf("failed to connect to proxy %s: %s: %q", proxyURL.Redacted(), resp.Status, b)
160161
}
161162
// 200 CONNECT: do NOT resp.Body.Close(); it would interfere with the tunnel.
162163
return &connWithBufferedReader{Conn: conn, r: br}, nil

0 commit comments

Comments
 (0)