Improve failure message
[netconf.git] / netconf / netconf-topology / src / main / java / org / opendaylight / netconf / topology / spi / AbstractNetconfTopology.java
index c7dbb703de40c0a1e585e46d15ce5b89b8925bef..974b0be68efd826bb54d7267c25428e2a284ddd2 100644 (file)
@@ -170,12 +170,13 @@ public abstract class AbstractNetconfTopology implements NetconfTopology {
 
     @Override
     public ListenableFuture<Empty> disconnectNode(final NodeId nodeId) {
-        LOG.debug("Disconnecting RemoteDevice{{}}", nodeId.getValue());
+        final var nodeName = nodeId.getValue();
+        LOG.debug("Disconnecting RemoteDevice{{}}", nodeName);
 
         final NetconfConnectorDTO connectorDTO = activeConnectors.remove(nodeId);
         if (connectorDTO == null) {
             return Futures.immediateFailedFuture(
-                new IllegalStateException("Unable to disconnect device that is not connected"));
+                new IllegalStateException("Cannot disconnect " + nodeName + " as it is not connected"));
         }
 
         connectorDTO.close();