2 * Copyright (C) 2013 EBay Software Foundation
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 * Authors : Ashwin Raveendran
10 package org.opendaylight.ovsdb.lib.jsonrpc;
12 import io.netty.channel.ChannelHandlerAdapter;
13 import io.netty.channel.ChannelHandlerContext;
14 import io.netty.handler.codec.TooLongFrameException;
16 public class ExceptionHandler extends ChannelHandlerAdapter {
19 public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
20 if ((cause instanceof InvalidEncodingException)
21 || (cause instanceof TooLongFrameException)) {
23 ctx.channel().disconnect();