Make AbstractSessionNegotiator react to exceptions 23/4523/3
authorRobert Varga <rovarga@cisco.com>
Tue, 21 Jan 2014 20:14:58 +0000 (21:14 +0100)
committerEd Warnicke <eaw@cisco.com>
Thu, 23 Jan 2014 02:10:04 +0000 (02:10 +0000)
While the SessionNegotiator is present on the pipeline it should react
to exceptions happening on the channel by failing negotiation.

Change-Id: I6571dc25f17c7afe8fa4e4eb58f70ad0bb3397a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java

index 5555fda7d5a25f98574c5bbe01dd1e7df95497c8..9f9f811e889f85c20352db331187f008b812bd85 100644 (file)
@@ -67,8 +67,14 @@ public abstract class AbstractSessionNegotiator<M, S extends AbstractProtocolSes
         try {
             handleMessage((M)msg);
         } catch (Exception e) {
         try {
             handleMessage((M)msg);
         } catch (Exception e) {
-            logger.debug("Unexpected exception during negotiation", e);
+            logger.debug("Unexpected error while handling negotiation message {}", msg, e);
             negotiationFailed(e);
         }
     }
             negotiationFailed(e);
         }
     }
+
+    @Override
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
+        logger.info("Unexpected error during negotiation", cause);
+        negotiationFailed(cause);
+    }
 }
 }