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