Merge "Log the address and port when binding fails"
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / UdpHandler.java
index 32f164be9c8b5342c43eacdef9f5f58e74ab50ce..0fef5d45399fdf67b956d48d296b9b1423836617 100644 (file)
@@ -65,6 +65,7 @@ public final class UdpHandler implements ServerFacade {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void run() {
         final ChannelFuture f;
         try {
@@ -80,6 +81,10 @@ public final class UdpHandler 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 {