Skip to content

Commit

Permalink
Include id to the error msg when it's too long (#49433)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredTan95 authored and dnhatn committed Nov 24, 2019
1 parent df760fe commit 1140ebf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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: " +
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

0 comments on commit 1140ebf

Please sign in to comment.