mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-13 10:21:10 +01:00
Replace error message to ctx.Err()
This commit is contained in:
parent
3d81a0a07d
commit
f28b4555b5
@ -2,7 +2,6 @@ package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"sync"
|
||||
@ -130,7 +129,7 @@ func (p *Peer) writeWithTimeout(ctx context.Context, buf []byte) (int, error) {
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return 0, fmt.Errorf("write operation timed out")
|
||||
return 0, ctx.Err()
|
||||
case <-writeDone:
|
||||
return n, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user