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
9 package org.opendaylight.openflowplugin.impl.connection;
11 import org.opendaylight.openflowplugin.api.ConnectionException;
12 import org.opendaylight.openflowplugin.api.openflow.md.core.ErrorHandler;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
17 * dumping all exceptions to log
19 public class ErrorHandlerSimpleImpl implements ErrorHandler {
21 private static final Logger LOG = LoggerFactory
22 .getLogger(ErrorHandlerSimpleImpl.class);
25 public void handleException(Throwable e) {
26 if (e instanceof ConnectionException) {
27 LOG.warn("exception -> {}", e.getMessage(), e);
29 LOG.error("exception -> {}", e.getMessage(), e);