From 0a21bc28eb98b6be9d3ed22dc49c4d15af7aff45 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Tue, 6 Jul 2021 14:09:25 -0500 Subject: [PATCH] include attempted bind address in DotNetty binding failure messages (#5132) * close #5130 - include attempted bind address in binding failure messages * forgot to add semicolon * added inner exception back * added note about InnerException containing descriptive socket error --- .../Transport/DotNetty/DotNettyTransport.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs b/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs index 49f1bbf497c..ff2d79eca1c 100644 --- a/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs +++ b/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs @@ -159,12 +159,19 @@ protected async Task NewServer(EndPoint listenAddress) if (InternalTransport != TransportMode.Tcp) throw new NotImplementedException("Haven't implemented UDP transport at this time"); - if (listenAddress is DnsEndPoint dns) + try { - listenAddress = await DnsToIPEndpoint(dns).ConfigureAwait(false); - } + if (listenAddress is DnsEndPoint dns) + { + listenAddress = await DnsToIPEndpoint(dns).ConfigureAwait(false); + } - return await ServerFactory().BindAsync(listenAddress).ConfigureAwait(false); + return await ServerFactory().BindAsync(listenAddress).ConfigureAwait(false); + } + catch (Exception ex) + { + throw new RemoteTransportException($"Failed to bind to [{listenAddress}]. See InnerException for details.", ex); + } } public override async Task<(Address, TaskCompletionSource)> Listen()