Skip to content

Commit 2d59a7f

Browse files
committed
internal/teeproxy: wrap the right error
The current error being wrapped isn't the actual error being returned by the function. So wrap the correct one. Change-Id: If00cf2a040d265649d863a10f1d4b5882b5a9d57 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/249439 Run-TryBot: Shaquille Que <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]> Reviewed-by: Julie Qiu <[email protected]>
1 parent 6440758 commit 2d59a7f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/teeproxy/teeproxy.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,13 @@ func getGddoEvent(r *http.Request) (gddoEvent *RequestEvent, err error) {
370370
// makePkgGoDevRequest makes a request to the redirectHost and redirectPath,
371371
// and returns a requestEvent based on the output.
372372
func (s *Server) makePkgGoDevRequest(ctx context.Context, redirectHost, redirectPath string) *RequestEvent {
373-
var err error
374-
defer derrors.Wrap(&err, "makePkgGoDevRequest(%q, %q)", redirectHost, redirectPath)
375373
redirectURL := redirectHost + redirectPath
376374
event := &RequestEvent{
377375
Host: redirectHost,
378376
Path: redirectPath,
379377
URL: redirectURL,
380378
}
379+
defer derrors.Wrap(&event.Error, "makePkgGoDevRequest(%q, %q)", redirectHost, redirectPath)
381380

382381
req, err := http.NewRequest("GET", redirectURL, nil)
383382
if err != nil {

0 commit comments

Comments
 (0)