Skip to content

Commit 1f176ce

Browse files
authored
fix: not handling epipe error (#30)
* fix: not handling epipe error * fix: lint
1 parent 04dcb29 commit 1f176ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/rcon/rcon.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"strings"
1111
"sync"
1212
"sync/atomic"
13+
"syscall"
1314

1415
"github.com/cenkalti/backoff/v4"
1516
"github.com/gorcon/rcon"
@@ -81,7 +82,7 @@ func NewRCON() func(NewRCONParams) (RCON, error) {
8182
}
8283

8384
ctx, cancel := context.WithCancel(context.Background())
84-
connWrapper.ctx = ctx //nolint:fatcontext
85+
connWrapper.ctx = ctx
8586
connWrapper.cancel = cancel
8687

8788
// Start the connection manager
@@ -218,6 +219,7 @@ func (r *RCONConn) Execute(ctx context.Context, command string) (string, error)
218219
if err != nil {
219220
if !strings.Contains(err.Error(), "use of closed network connection") &&
220221
!strings.Contains(err.Error(), "connection reset by peer") &&
222+
!errors.Is(err, syscall.EPIPE) &&
221223
!errors.Is(err, io.EOF) {
222224
return "", err
223225
}

0 commit comments

Comments
 (0)