2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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 package org.opendaylight.openflowplugin.impl.connection;
10 import org.opendaylight.openflowplugin.api.ConnectionException;
11 import org.opendaylight.openflowplugin.api.openflow.md.core.ErrorHandler;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
16 * dumping all exceptions to log.
18 public class ErrorHandlerSimpleImpl implements ErrorHandler {
20 private static final Logger LOG = LoggerFactory
21 .getLogger(ErrorHandlerSimpleImpl.class);
24 public void handleException(Throwable throwable) {
25 if (throwable instanceof ConnectionException) {
26 LOG.warn("Exception", throwable);
28 LOG.error("Exception", throwable);