Catch Exceptions, not Throwable to remove blockers found in SonarQube
Change-Id: I49ab731ce0c9950b55063e2afa4ce9226a7b6b4a
diff --git a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
index b49814f..ebc17ca 100644
--- a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
@@ -400,7 +400,7 @@
extraneousFlow(rule);
}
}
- } catch (Throwable e) {
+ } catch (Exception e) {
log.debug("Can't process added or extra rule {}", e.getMessage());
continue;
}
@@ -409,7 +409,7 @@
try {
// there are rules in the store that aren't on the switch
flowMissing(rule);
- } catch (Throwable e) {
+ } catch (Exception e) {
log.debug("Can't add missing flow rule {}", e.getMessage());
continue;
}
diff --git a/utils/netty/src/main/java/org/onlab/netty/NettyMessagingManager.java b/utils/netty/src/main/java/org/onlab/netty/NettyMessagingManager.java
index bfc1c70..f550498 100644
--- a/utils/netty/src/main/java/org/onlab/netty/NettyMessagingManager.java
+++ b/utils/netty/src/main/java/org/onlab/netty/NettyMessagingManager.java
@@ -102,8 +102,8 @@
serverChannelClass = EpollServerSocketChannel.class;
clientChannelClass = EpollSocketChannel.class;
return;
- } catch (Throwable t) {
- log.warn("Failed to initialize native (epoll) transport. Reason: {}. Proceeding with nio.", t.getMessage());
+ } catch (Exception e) {
+ log.warn("Failed to initialize native (epoll) transport. Reason: {}. Proceeding with nio.", e.getMessage());
}
clientGroup = new NioEventLoopGroup();
serverGroup = new NioEventLoopGroup();
diff --git a/utils/nio/src/main/java/org/onlab/nio/SelectorLoop.java b/utils/nio/src/main/java/org/onlab/nio/SelectorLoop.java
index 605e0a9..95a9b61 100644
--- a/utils/nio/src/main/java/org/onlab/nio/SelectorLoop.java
+++ b/utils/nio/src/main/java/org/onlab/nio/SelectorLoop.java
@@ -103,7 +103,7 @@
state = State.STARTING;
try {
loop();
- } catch (Throwable e) {
+ } catch (Exception e) {
error = e;
log.error("Loop aborted", e);
}