* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.netconf.server.util;
+package org.opendaylight.netconf.server;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import java.util.Map;
import org.opendaylight.netconf.api.DocumentedException;
-import org.opendaylight.netconf.server.SendErrorExceptionUtil;
import org.opendaylight.yangtools.yang.common.ErrorSeverity;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public final class DeserializerExceptionHandler extends ChannelInboundHandlerAdapter {
+final class DeserializerExceptionHandler extends ChannelInboundHandlerAdapter {
private static final Logger LOG = LoggerFactory.getLogger(DeserializerExceptionHandler.class);
@Override
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
LOG.warn("An exception occurred during message handling", cause);
- handleDeserializerException(ctx, cause);
- }
- private static void handleDeserializerException(final ChannelHandlerContext ctx, final Throwable cause) {
final String message = cause.getMessage();
SendErrorExceptionUtil.sendErrorMessage(ctx.channel(), new DocumentedException(message,
ErrorType.RPC, ErrorTag.MALFORMED_MESSAGE, ErrorSeverity.ERROR,
import io.netty.channel.Channel;
import io.netty.util.concurrent.Promise;
import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
-import org.opendaylight.netconf.server.util.DeserializerExceptionHandler;
public final class ServerChannelInitializer extends AbstractChannelInitializer<NetconfServerSession> {
private static final String DESERIALIZER_EX_HANDLER_KEY = "deserializerExHandler";
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.netconf.server.util;
+package org.opendaylight.netconf.server;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;