Skip to content

Commit

Permalink
Giving informative error messages for double slashes in API call URLs (
Browse files Browse the repository at this point in the history
…#1568)

* Signed-off-by: Megha Sai Kavikondala <[email protected]>

Changes related to Informative error messages.

* Signed-off-by: Megha Sai Kavikondala <[email protected]>

Spotless changes

* Signed-off-by: Megha Sai Kavikondala <[email protected]>

naming and message changes.

Signed-off-by: Megha Sai Kavikondala <[email protected]>

* Signed-off-by: Megha Sai Kavikondala <[email protected]>

Deleting the log message.
  • Loading branch information
meghasaik authored Nov 22, 2021
1 parent 0c21689 commit 12a2294
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ public static void validateIndexOrAliasName(String index, BiFunction<String, Str
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 '#'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ public void testValidateIndexName() throws Exception {
validateIndexName(checkerService, "..", "must not be '.' or '..'");

validateIndexName(checkerService, "foo:bar", "must not contain ':'");

validateIndexName(checkerService, "", "Invalid index name [], must not be empty");
}));
}

Expand Down

0 comments on commit 12a2294

Please sign in to comment.