mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-01-13 01:12:01 -06:00
improve error for repeated parameter name
This commit is contained in:
parent
d838327fd1
commit
b8dab000e2
@ -41,7 +41,7 @@ public class Cmd {
|
||||
|
||||
public static CmdType valueOfAnyCase(String cmdname) {
|
||||
for (CmdType value : values()) {
|
||||
if (cmdname.equals(value.toString()) || cmdname.toLowerCase().equals(value.toString().toLowerCase())) {
|
||||
if (cmdname.equals(value.toString()) || cmdname.equalsIgnoreCase(value.toString())) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@ -162,7 +162,8 @@ public class Cmd {
|
||||
pval = fixer.canonicalizePath(pval);
|
||||
}
|
||||
if (params.containsKey(pname)) {
|
||||
throw new InvalidParameterException("parameter '" + pname + "' is already set for " + cmdType);
|
||||
throw new InvalidParameterException("parameter '" + pname + "' is already set for '" + cmdType +"' command. For each command," +
|
||||
" a named parameter may only be set once. Multiple occurrences are disallowed to avoid errors or ambiguity.");
|
||||
}
|
||||
params.put(pname, pval);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user