Bug 7499 - ensure statistics scheduler does not die and keep trying while the control...
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / StatisticsContextImpl.java
index eab57c27958dd96bb539a608fb38a525553115a9..4b5b7be9ca84ba0be030879e7521eb8b4a6821ab 100644 (file)
@@ -30,6 +30,7 @@ import javax.annotation.Nullable;
 import javax.annotation.concurrent.GuardedBy;
 import org.opendaylight.mdsal.common.api.TransactionChainClosedException;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.openflowplugin.api.ConnectionException;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
@@ -276,7 +277,7 @@ class StatisticsContextImpl implements StatisticsContext {
             final String errMsg = String.format("Device connection is closed for Node : %s.",
                     getDeviceInfo().getNodeId());
             LOG.debug(errMsg);
-            resultFuture.setException(new IllegalStateException(errMsg));
+            resultFuture.setException(new ConnectionException(errMsg));
             return;
         }
         if ( ! iterator.hasNext()) {