diff options
author | Micael Karlberg <[email protected]> | 2011-12-08 14:46:18 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-02-03 18:20:47 +0100 |
commit | 2919a7505963054e442cf2e8fc9ff46739a0d0d9 (patch) | |
tree | d66fda5145c62428c707ce02751e3a16923ae314 /lib/inets/src/http_client | |
parent | ab2ba6f1b0713fbe5c78f67aeefb73ffc006e995 (diff) | |
download | otp-2919a7505963054e442cf2e8fc9ff46739a0d0d9.tar.gz otp-2919a7505963054e442cf2e8fc9ff46739a0d0d9.tar.bz2 otp-2919a7505963054e442cf2e8fc9ff46739a0d0d9.zip |
[inets] Added more error info when connect fails
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index bfe9b14ef6..714fd6f16d 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -852,13 +852,14 @@ connect(SocketType, ToAddress, inet6fb4 -> Opts3 = [inet6 | Opts2], case http_transport:connect(SocketType, ToAddress, Opts3, Timeout) of - {error, _Reason} = Error -> + {error, Reason6} -> Opts4 = [inet | Opts2], case http_transport:connect(SocketType, ToAddress, Opts4, Timeout) of - {error, _} -> - %% Reply with the "original" error - Error; + {error, Reason4} -> + {error, {failed_connect, + [{inet6, Opts3, Reason6}, + {inet, Opts4, Reason4}]}}; OK -> OK end; @@ -867,7 +868,12 @@ connect(SocketType, ToAddress, end; _ -> Opts3 = [IpFamily | Opts2], - http_transport:connect(SocketType, ToAddress, Opts3, Timeout) + case http_transport:connect(SocketType, ToAddress, Opts3, Timeout) of + {error, Reason} -> + {error, {failed_connect, [{IpFamily, Opts3, Reason}]}}; + Else -> + Else + end end. connect_and_send_first_request(Address, Request, #state{options = Options} = State) -> |