Bug 1764 - moved Session related interfaces to openflowplugin-api
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / ErrorHandlerSimpleImpl.java
index f9156eb4ac4fc7149e1aadd97879d8048a2e3c38..f4cad4e3627b27f9c1acec7f3ea2b70b450cacbc 100644 (file)
@@ -10,7 +10,9 @@ package org.opendaylight.openflowplugin.openflow.md.core;
 
 import java.util.Arrays;
 
-import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext;
+import org.opendaylight.openflowplugin.ConnectionException;
+import org.opendaylight.openflowplugin.api.openflow.md.core.ErrorHandler;
+import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,6 +32,10 @@ public class ErrorHandlerSimpleImpl implements ErrorHandler {
             sessionKeyId = Arrays.toString(sessionContext.getSessionKey().getId());
         }
         
-        LOG.error("exception -> {}, session -> {}", e.getMessage(), sessionKeyId, e);
+        if (e instanceof ConnectionException) {
+            LOG.warn("exception -> {}, session -> {}", e.getMessage(), sessionKeyId, e);
+        } else {
+            LOG.error("exception -> {}, session -> {}", e.getMessage(), sessionKeyId, e);
+        }
     }
 }