2 * Copyright (c) 2014 Brocade Communications 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.controller.cluster.datastore.exceptions;
10 import com.google.common.base.Strings;
13 * Exception indicating a shard has no current leader.
15 * @author Thomas Pantelis
17 public class NoShardLeaderException extends RuntimeException {
18 private static final long serialVersionUID = 1L;
20 public NoShardLeaderException(String message) {
24 public NoShardLeaderException(String message, String shardName) {
25 super(String.format("%sShard %s currently has no leader. Try again later.",
26 (Strings.isNullOrEmpty(message) ? "" : message + ". "), shardName));