fix error message on invalid template name
This commit is contained in:
parent
6b11b760ae
commit
76654f1d0d
|
@ -148,6 +148,9 @@ public class MetaDataIndexTemplateService extends AbstractComponent {
|
||||||
if (!request.name.toLowerCase().equals(request.name)) {
|
if (!request.name.toLowerCase().equals(request.name)) {
|
||||||
throw new InvalidIndexTemplateException(request.name, "name must be lower cased");
|
throw new InvalidIndexTemplateException(request.name, "name must be lower cased");
|
||||||
}
|
}
|
||||||
|
if (!request.name.toLowerCase().equals(request.name)) {
|
||||||
|
throw new InvalidIndexTemplateException(request.name, "name must be lower cased");
|
||||||
|
}
|
||||||
if (request.template.contains(" ")) {
|
if (request.template.contains(" ")) {
|
||||||
throw new InvalidIndexTemplateException(request.name, "template must not contain a space");
|
throw new InvalidIndexTemplateException(request.name, "template must not contain a space");
|
||||||
}
|
}
|
||||||
|
@ -160,9 +163,6 @@ public class MetaDataIndexTemplateService extends AbstractComponent {
|
||||||
if (request.template.startsWith("_")) {
|
if (request.template.startsWith("_")) {
|
||||||
throw new InvalidIndexTemplateException(request.name, "template must not start with '_'");
|
throw new InvalidIndexTemplateException(request.name, "template must not start with '_'");
|
||||||
}
|
}
|
||||||
if (!request.name.toLowerCase().equals(request.name)) {
|
|
||||||
throw new InvalidIndexTemplateException(request.name, "template must be lower cased");
|
|
||||||
}
|
|
||||||
if (!Strings.validFileNameExcludingAstrix(request.template)) {
|
if (!Strings.validFileNameExcludingAstrix(request.template)) {
|
||||||
throw new InvalidIndexTemplateException(request.name, "template must not container the following characters " + Strings.INVALID_FILENAME_CHARS);
|
throw new InvalidIndexTemplateException(request.name, "template must not container the following characters " + Strings.INVALID_FILENAME_CHARS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue