aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2015-10-23 17:16:38 +0100
committerMagnus Henoch <[email protected]>2015-10-23 17:16:38 +0100
commit902ed3fe77d674fdbed3ee60ee613861ce2f1943 (patch)
treef020a356dbad89a3564405f8a5da960ebf2f65af /lib/ssl
parentba49561cf3e2167acd5457de93b05e772f2fb16a (diff)
downloadotp-902ed3fe77d674fdbed3ee60ee613861ce2f1943.tar.gz
otp-902ed3fe77d674fdbed3ee60ee613861ce2f1943.tar.bz2
otp-902ed3fe77d674fdbed3ee60ee613861ce2f1943.zip
In ssl_tls_dist_proxy, pass along EPMD registration errors
The duplicate_name error returned from erl_epmd:register_node elicits a particularly precise error message from net_kernel, so let's pass it along to our caller. Not doing this for the other things that could go wrong here, since for those having the line number will likely aid debugging.
Diffstat (limited to 'lib/ssl')
-rw-r--r--lib/ssl/src/ssl_tls_dist_proxy.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl_tls_dist_proxy.erl b/lib/ssl/src/ssl_tls_dist_proxy.erl
index 273d3b5521..ce742948b7 100644
--- a/lib/ssl/src/ssl_tls_dist_proxy.erl
+++ b/lib/ssl/src/ssl_tls_dist_proxy.erl
@@ -66,9 +66,13 @@ handle_call({listen, Name}, _From, State) ->
{ok, TcpAddress} = get_tcp_address(Socket),
{ok, WorldTcpAddress} = get_tcp_address(World),
{_,Port} = WorldTcpAddress#net_address.address,
- {ok, Creation} = erl_epmd:register_node(Name, Port),
- {reply, {ok, {Socket, TcpAddress, Creation}},
- State#state{listen={Socket, World}}};
+ case erl_epmd:register_node(Name, Port) of
+ {ok, Creation} ->
+ {reply, {ok, {Socket, TcpAddress, Creation}},
+ State#state{listen={Socket, World}}};
+ {error, _} = Error ->
+ {reply, Error, State}
+ end;
Error ->
{reply, Error, State}
end;