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.openflow.md.core;
11 import java.util.Arrays;
13 import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
18 * dumping all exceptions to log
21 public class ErrorHandlerSimpleImpl implements ErrorHandler {
23 private static final Logger LOG = LoggerFactory
24 .getLogger(ErrorHandlerSimpleImpl.class);
27 public void handleException(Throwable e, SessionContext sessionContext) {
28 String sessionKeyId = null;
29 if (sessionContext != null) {
30 sessionKeyId = Arrays.toString(sessionContext.getSessionKey().getId());
33 LOG.error("exception -> {}, session -> {}", e.getMessage(), sessionKeyId, e);