BUG-1557 crypting error 90/9990/3
authorMichal Rehak <mirehak@cisco.com>
Fri, 15 Aug 2014 19:26:54 +0000 (21:26 +0200)
committerPrasanna Huddar <prasanna.k.huddar@gmail.com>
Tue, 19 Aug 2014 17:49:23 +0000 (17:49 +0000)
- changed to warning
- added beautiful message

Change-Id: I99f999900893f50f704fb95a03e32537d2940358
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/ErrorHandlerSimpleImpl.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/HandshakeManagerImpl.java

index f9156eb4ac4fc7149e1aadd97879d8048a2e3c38..e12c1e94420db9539fc6a608e60059e3f5769103 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.openflowplugin.openflow.md.core;
 
 import java.util.Arrays;
 
+import org.opendaylight.openflowplugin.ConnectionException;
 import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -30,6 +31,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);
+        }
     }
 }
index bdb13f748fdca34e563f1ba795bb73a5114869ac..db88573e8209fb0a7f6ff959aa0054771aa823d3 100644 (file)
@@ -13,6 +13,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
+import org.opendaylight.openflowplugin.ConnectionException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
@@ -287,8 +288,10 @@ public class HandshakeManagerImpl implements HandshakeManager {
             RpcUtil.smokeRpc(helloResult);
             LOG.debug("FIRST HELLO sent.");
         } catch (Exception e) {
-            LOG.debug("FIRST HELLO sending failed.");
-            throw e;
+            if (LOG.isTraceEnabled()) {
+                LOG.trace("FIRST HELLO sent.", e);
+            }
+            throw new ConnectionException("FIRST HELLO sending failed because of connection issue.");
         }
     }