Currently, when we fail to bind, the error appears in a Netty thread
and is only logged if we have a last-chance logger on the relevant
thread. This patch ensures that TcpHandler and UdpHandler log binding
errors with an informative error message.
Change-Id: I687d84cec09d1ed2389bed9e2e04e50cd1296850
JIRA: OPNFLWPLUG-1054
Signed-off-by: Stephen Kitt <skitt@redhat.com>
* Starts server on selected port.
*/
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void run() {
/*
* We generally do not perform IO-unrelated tasks, so we want to have
} catch (InterruptedException e) {
LOG.error("Interrupted while binding port {}", port, e);
return;
+ } catch (Throwable throwable) {
+ // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+ LOG.error("Error while binding address {} and port {}", startupAddress, port, throwable);
+ throw throwable;
}
try {
}
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void run() {
final ChannelFuture f;
try {
} catch (InterruptedException e) {
LOG.error("Interrupted while binding port {}", port, e);
return;
+ } catch (Throwable throwable) {
+ // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+ LOG.error("Error while binding address {} and port {}", startupAddress, port, throwable);
+ throw throwable;
}
try {