Merge "BUG-731: do not catch Throwable"
authorTony Tkacik <ttkacik@cisco.com>
Wed, 16 Apr 2014 17:07:00 +0000 (17:07 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 16 Apr 2014 17:07:00 +0000 (17:07 +0000)
opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java

index 753de4a..ecf116b 100644 (file)
@@ -86,8 +86,8 @@ public class PacketHandler implements PacketProcessingListener {
 
       handleEthernetPacket(packet, ingress);
 
-    } catch(Throwable _e) {
-      _e.printStackTrace();
+    } catch(Exception e) {
+      _logger.error("Failed to handle packet {}", packetReceived, e);
     }
   }
 
index eb6fd27..1616857 100644 (file)
@@ -90,10 +90,10 @@ class ConfigPersisterNotificationListener implements NotificationListener {
         if (notification instanceof CommitJMXNotification) {
             try {
                 handleAfterCommitNotification((CommitJMXNotification) notification);
-            } catch (Throwable e) {
+            } catch (Exception e) {
                 // log exceptions from notification Handler here since
                 // notificationBroadcastSupport logs only DEBUG level
-                logger.warn("Exception occured during notification handling: ", e);
+                logger.warn("Failed to handle notification {}", notification, e);
                 throw e;
             }
         } else {
@@ -110,4 +110,4 @@ class ConfigPersisterNotificationListener implements NotificationListener {
             throw new RuntimeException("Unable to persist configuration snapshot", e);
         }
     }
-}
\ No newline at end of file
+}

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.