Skip to content

Commit

Permalink
fix: add "server closed" as connection error (#3355)
Browse files Browse the repository at this point in the history
add "server closed" as connection error
  • Loading branch information
mathnogueira committed Nov 14, 2023
1 parent 33783c4 commit 4d13812
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion agent/client/client.go
Expand Up @@ -193,7 +193,21 @@ func (c *Client) handleDisconnectionError(inputErr error) (bool, error) {
}

func isConnectionError(err error) bool {
return err != nil && strings.Contains(err.Error(), "connection refused")
if err == nil {
return false
}

possibleErrors := []string{
"connection refused",
"server closed",
}
for _, possibleErr := range possibleErrors {
if strings.Contains(err.Error(), possibleErr) {
return true
}
}

return false
}

func isEndOfFileError(err error) bool {
Expand Down

0 comments on commit 4d13812

Please sign in to comment.