Wrap correct error on unix.GetsockoptUcred failure
Wrap ucredErr which is set by unix.GetsockoptUcred, not the nil err. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit is contained in:
parent
0247db16a1
commit
5b394b91bd
@ -50,7 +50,7 @@ func (fn UnixCredentialsFunc) Handshake(ctx context.Context, conn net.Conn) (net
|
||||
}
|
||||
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user