Merge pull request #100 from tklauser/ucred-wrap-err

Wrap correct error on unix.GetsockoptUcred failure
This commit is contained in:
Derek McGowan 2022-01-21 15:00:05 -08:00 committed by GitHub
commit 332f4c9a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ func (fn UnixCredentialsFunc) Handshake(_ context.Context, conn net.Conn) (net.C
} }
if ucredErr != nil { if ucredErr != nil {
return nil, nil, fmt.Errorf("ttrpc.UnixCredentialsFunc: failed to retrieve socket peer credentials: %w", err) return nil, nil, fmt.Errorf("ttrpc.UnixCredentialsFunc: failed to retrieve socket peer credentials: %w", ucredErr)
} }
if err := fn(ucred); err != nil { if err := fn(ucred); err != nil {