Giving informative error messages for double slashes in API call URLs (#1568)

* Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com>

Changes related to Informative error messages.

* Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com>

Spotless changes

* Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com>

naming and message changes.

Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com>

* Signed-off-by: Megha Sai Kavikondala <kavmegha@amazon.com>

Deleting the log message.
This commit is contained in:
Megha Sai Kavikondala 2021-11-22 15:01:39 -08:00 committed by GitHub
parent 0c21689202
commit 12a229410c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -250,6 +250,9 @@ public class MetadataCreateIndexService {
if (!Strings.validFileName(index)) {
throw exceptionCtor.apply(index, "must not contain the following characters " + Strings.INVALID_FILENAME_CHARS);
}
if (index.isEmpty()) {
throw exceptionCtor.apply(index, "must not be empty");
}
if (index.contains("#")) {
throw exceptionCtor.apply(index, "must not contain '#'");
}

View File

@ -626,6 +626,8 @@ public class MetadataCreateIndexServiceTests extends OpenSearchTestCase {
validateIndexName(checkerService, "..", "must not be '.' or '..'");
validateIndexName(checkerService, "foo:bar", "must not contain ':'");
validateIndexName(checkerService, "", "Invalid index name [], must not be empty");
}));
}