@cryptotaxi247 / kubo / commits / 20908b307

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>

Marcin Janczyk committed Sep 24, 2015 at 22:42 UTC 20908b3072a761971c19c6a753a8bebde30032dc
1 file changed +2 -1
cmd/ipfs/main.go
+2 -1
@@ -668,5 +668,6 @@ func apiClientForAddr(addr ma.Multiaddr) (cmdsHttp.Client, error) {
668 }
669
670 func isConnRefused(err error) bool {
671 - return strings.Contains(err.Error(), "connection refused")
671 + return strings.Contains(err.Error(), "connection refused") ||
672 + strings.Contains(err.Error(), "target machine actively refused it")
673 }