*/
package org.opendaylight.controller.cluster.datastore.exceptions;
+import com.google.common.base.Strings;
+
/**
* Exception indicating a shard has no current leader.
*
public class NoShardLeaderException extends RuntimeException {
private static final long serialVersionUID = 1L;
- public NoShardLeaderException(String message){
+ public NoShardLeaderException(String message) {
super(message);
}
+
+ public NoShardLeaderException(String message, String shardName) {
+ super(String.format("%sShard %s currently has no leader. Try again later.",
+ (Strings.isNullOrEmpty(message) ? "" : message + ". "), shardName));
+ }
}