From: Tony Tkacik Date: Wed, 16 Apr 2014 17:07:00 +0000 (+0000) Subject: Merge "BUG-731: do not catch Throwable" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~213 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=cb98269f3ccd77787672053054910696e4eea470;hp=408eeef51f435abd2027f9d25ac5592066b202dd Merge "BUG-731: do not catch Throwable" --- diff --git a/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java b/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java index 753de4aa85..ecf116b171 100644 --- a/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java +++ b/opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java @@ -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); } } diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java index eb6fd2722a..1616857949 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java @@ -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 +}