Merge "Log the address and port when binding fails"
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / TcpHandler.java
index 46dfd14d40cbec1b26c3407f8ac3ac04af3d25d4..288c58c92968612ad31f8117c7b2204d0351aa6a 100644 (file)
@@ -86,6 +86,7 @@ public class TcpHandler implements ServerFacade {
      * 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
@@ -121,6 +122,10 @@ public class TcpHandler implements ServerFacade {
         } 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 {