fixes to catch proper netconf exception
- part of ONOS-7020
Change-Id: I55c02ca9fdb97f1ae12b4e3d7b76da565f9da741
diff --git a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java
index f61b837..c60c448 100644
--- a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java
+++ b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java
@@ -25,10 +25,10 @@
import org.onosproject.net.device.PortDescription;
import org.onosproject.net.driver.AbstractHandlerBehaviour;
import org.onosproject.netconf.NetconfController;
+import org.onosproject.netconf.NetconfException;
import org.onosproject.netconf.NetconfSession;
import org.slf4j.Logger;
-import java.io.IOException;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -59,7 +59,7 @@
try {
sysInfo = session.get(requestBuilder(REQ_SYS_INFO));
chassis = session.get(requestBuilder(REQ_MAC_ADD_INFO));
- } catch (IOException e) {
+ } catch (NetconfException e) {
log.warn("Failed to retrieve device details for {}", devId);
return null;
}
@@ -80,7 +80,7 @@
String reply;
try {
reply = session.get(requestBuilder(REQ_IF_INFO));
- } catch (IOException e) {
+ } catch (NetconfException e) {
log.warn("Failed to retrieve ports for device {}", devId);
return ImmutableList.of();
}