Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Cleanup warnings
[controller.git]
/
opendaylight
/
md-sal
/
sal-distributed-datastore
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
datastore
/
exceptions
/
NoShardLeaderException.java
diff --git
a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/NoShardLeaderException.java
b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/NoShardLeaderException.java
index b205b0fe7853c176be3f92ef2a2f3d3fd952dbab..8365177d1b9307ae9c6cd7681d8cfdac0c50d2d9 100644
(file)
--- a/
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/NoShardLeaderException.java
+++ b/
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/NoShardLeaderException.java
@@
-7,6
+7,8
@@
*/
package org.opendaylight.controller.cluster.datastore.exceptions;
*/
package org.opendaylight.controller.cluster.datastore.exceptions;
+import com.google.common.base.Strings;
+
/**
* Exception indicating a shard has no current leader.
*
/**
* Exception indicating a shard has no current leader.
*
@@
-15,7
+17,12
@@
package org.opendaylight.controller.cluster.datastore.exceptions;
public class NoShardLeaderException extends RuntimeException {
private static final long serialVersionUID = 1L;
public class NoShardLeaderException extends RuntimeException {
private static final long serialVersionUID = 1L;
- public NoShardLeaderException(String message){
+ public NoShardLeaderException(String message)
{
super(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));
+ }
}
}