fixes to catch proper netconf exception
- part of ONOS-7020
Change-Id: I55c02ca9fdb97f1ae12b4e3d7b76da565f9da741
diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/cli/impl/NetconfConfigGetCommand.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/cli/impl/NetconfConfigGetCommand.java
index b7651a5..bac6bef 100644
--- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/cli/impl/NetconfConfigGetCommand.java
+++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/cli/impl/NetconfConfigGetCommand.java
@@ -18,14 +18,13 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.netconf.DatastoreId.datastore;
-import java.io.IOException;
-
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.net.DeviceId;
import org.onosproject.netconf.NetconfController;
import org.onosproject.netconf.NetconfDevice;
+import org.onosproject.netconf.NetconfException;
import org.onosproject.netconf.NetconfSession;
/**
@@ -71,7 +70,7 @@
try {
String res = session.getConfig(datastore(cfgType.toLowerCase()));
print("%s", res);
- } catch (IOException e) {
+ } catch (NetconfException e) {
log.error("Configuration could not be retrieved", e);
print("Error occurred retrieving configuration");
}