This fixes the bad practice of catching Throwable, and uses logger
instead of e.printStackTrace().
Change-Id: I44541f7c71dda0bcf633d22d9a46b3959ed3001f
Signed-off-by: Robert Varga <rovarga@cisco.com>
handleEthernetPacket(packet, ingress);
handleEthernetPacket(packet, ingress);
- } catch(Throwable _e) {
- _e.printStackTrace();
+ } catch(Exception e) {
+ _logger.error("Failed to handle packet {}", packetReceived, e);
if (notification instanceof CommitJMXNotification) {
try {
handleAfterCommitNotification((CommitJMXNotification) notification);
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
// 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 new RuntimeException("Unable to persist configuration snapshot", e);
}
}
throw new RuntimeException("Unable to persist configuration snapshot", e);
}
}
-}
\ No newline at end of file