1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00

Detect connection refused errors during API test on Windows

The first run does not try to connect to API, as an address is not
yet saved in configuration. The second run did not recognize
corrently a refused connection.

Fixes #1661.

License: MIT
Signed-off-by: Marcin Janczyk <marcinjanczyk@gmail.com>
This commit is contained in:
Marcin Janczyk
2015-09-24 22:42:14 +02:00
parent 9c6ec296e3
commit 20908b3072

View File

@ -668,5 +668,6 @@ func apiClientForAddr(addr ma.Multiaddr) (cmdsHttp.Client, error) {
}
func isConnRefused(err error) bool {
return strings.Contains(err.Error(), "connection refused")
return strings.Contains(err.Error(), "connection refused") ||
strings.Contains(err.Error(), "target machine actively refused it")
}