Skip to content

Commit

Permalink
print 'could not reach agent...' only in case of network error and no…
Browse files Browse the repository at this point in the history
…t HTTP returned error (#24696)
  • Loading branch information
misteriaud authored Apr 17, 2024
1 parent c8b5066 commit 312c83c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/api/util/ipc_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ func (end *IPCEndpoint) DoGet(options ...GetOption) ([]byte, error) {
if errStr, found := errMap["error"]; found {
return nil, errors.New(errStr)
}

return nil, fmt.Errorf("could not reach agent: %v\nMake sure the agent is running before requesting the runtime configuration and contact support if you continue having issues", err)
netErr := new(net.OpError)
if errors.As(err, &netErr) {
return nil, fmt.Errorf("could not reach agent: %v\nMake sure the agent is running before requesting the runtime configuration and contact support if you continue having issues", err)
}
return nil, err
}
return res, err
}
Expand Down

0 comments on commit 312c83c

Please sign in to comment.