Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print id detail when id is too long. #49433

Merged
merged 3 commits into from
Nov 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public ActionRequestValidationException validate() {
validationException = DocWriteRequest.validateSeqNoBasedCASParams(this, validationException);

if (id != null && id.getBytes(StandardCharsets.UTF_8).length > 512) {
validationException = addValidationError("id is too long, must be no longer than 512 bytes but was: " +
JaredTan95 marked this conversation as resolved.
Show resolved Hide resolved
validationException = addValidationError("id [" + id + "] is too long, must be no longer than 512 bytes but was: " +
id.getBytes(StandardCharsets.UTF_8).length, validationException);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void testIndexingRejectsLongIds() {
validate = request.validate();
assertThat(validate, notNullValue());
assertThat(validate.getMessage(),
containsString("id is too long, must be no longer than 512 bytes but was: 513"));
containsString("id [" + id + "] is too long, must be no longer than 512 bytes but was: 513"));
}

public void testWaitForActiveShards() {
Expand Down