Skip to content

Commit a458f1e

Browse files
opensearch-trigger-bot[bot]opensearch-ci-botandrross
authored andcommitted
[AUTO] [main] Add bwc version 2.19.3. (opensearch-project#18160)
* Add bwc version 2.19.3 Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Andrew Ross <andrross@amazon.com> * Fix version id Signed-off-by: Andrew Ross <andrross@amazon.com> --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Andrew Ross <andrross@amazon.com> Co-authored-by: opensearch-ci-bot <83309141+opensearch-ci-bot@users.noreply.github.com> Co-authored-by: Andrew Ross <andrross@amazon.com>
1 parent 00093ea commit a458f1e

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ BWC_VERSION:
4545
- "2.19.0"
4646
- "2.19.1"
4747
- "2.19.2"
48+
- "2.19.3"
4849
- "3.0.0"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3333
- Remove package org.opensearch.transport.grpc and replace with org.opensearch.plugin.transport.grpc ([#18031](https://github.com/opensearch-project/OpenSearch/pull/18031))
3434
- Fix the native plugin installation error cause by the pgp public key change ([#18147](https://github.com/opensearch-project/OpenSearch/pull/18147))
3535
- Fix object field exists query ([#17843](https://github.com/opensearch-project/OpenSearch/pull/17843))
36+
- Use Bad Request status for InputCoercionEcception ([#18161](https://github.com/opensearch-project/OpenSearch/pull/18161))
3637

3738
### Security
3839

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Security Vulnerabilities](https://img.shields.io/github/issues/opensearch-project/OpenSearch/security%20vulnerability?labelColor=red)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"security%20vulnerability")
88
[![Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch)](https://github.com/opensearch-project/OpenSearch/issues)
99
[![Open Pull Requests](https://img.shields.io/github/issues-pr/opensearch-project/OpenSearch)](https://github.com/opensearch-project/OpenSearch/pulls)
10-
[![2.19.2 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.19.2)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.19.2")
10+
[![2.19.3 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.19.3)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.19.3")
1111
[![2.18.1 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.18.1)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.18.1")
1212
[![3.0.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v3.0.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v3.0.0")
1313
[![GHA gradle check](https://github.com/opensearch-project/OpenSearch/actions/workflows/gradle-check.yml/badge.svg)](https://github.com/opensearch-project/OpenSearch/actions/workflows/gradle-check.yml)

libs/core/src/main/java/org/opensearch/ExceptionsHelper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
package org.opensearch;
3434

3535
import com.fasterxml.jackson.core.JsonParseException;
36+
import com.fasterxml.jackson.core.exc.InputCoercionException;
3637

3738
import org.apache.logging.log4j.LogManager;
3839
import org.apache.logging.log4j.Logger;
@@ -98,6 +99,8 @@ public static RestStatus status(Throwable t) {
9899
return ((OpenSearchException) t).status();
99100
} else if (t instanceof IllegalArgumentException) {
100101
return RestStatus.BAD_REQUEST;
102+
} else if (t instanceof InputCoercionException) {
103+
return RestStatus.BAD_REQUEST;
101104
} else if (t instanceof JsonParseException) {
102105
return RestStatus.BAD_REQUEST;
103106
} else if (t instanceof OpenSearchRejectedExecutionException) {
@@ -115,6 +118,8 @@ public static String summaryMessage(Throwable t) {
115118
return getExceptionSimpleClassName(t) + "[" + t.getMessage() + "]";
116119
} else if (t instanceof IllegalArgumentException) {
117120
return "Invalid argument";
121+
} else if (t instanceof InputCoercionException) {
122+
return "Incompatible JSON value";
118123
} else if (t instanceof JsonParseException) {
119124
return "Failed to parse JSON";
120125
} else if (t instanceof OpenSearchRejectedExecutionException) {

libs/core/src/main/java/org/opensearch/Version.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
116116
public static final Version V_2_19_0 = new Version(2190099, org.apache.lucene.util.Version.LUCENE_9_12_1);
117117
public static final Version V_2_19_1 = new Version(2190199, org.apache.lucene.util.Version.LUCENE_9_12_1);
118118
public static final Version V_2_19_2 = new Version(2190299, org.apache.lucene.util.Version.LUCENE_9_12_1);
119+
public static final Version V_2_19_3 = new Version(2190399, org.apache.lucene.util.Version.LUCENE_9_12_1);
119120
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_10_1_0);
120121
public static final Version V_3_1_0 = new Version(3010099, org.apache.lucene.util.Version.LUCENE_10_1_0);
121122
public static final Version CURRENT = V_3_1_0;

server/src/test/java/org/opensearch/ExceptionsHelperTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
package org.opensearch;
3434

3535
import com.fasterxml.jackson.core.JsonParseException;
36+
import com.fasterxml.jackson.core.exc.InputCoercionException;
3637

3738
import org.apache.commons.codec.DecoderException;
3839
import org.apache.lucene.index.CorruptIndexException;
@@ -110,12 +111,17 @@ private void assertError(final Throwable cause, final Error error) {
110111

111112
public void testStatus() {
112113
assertThat(ExceptionsHelper.status(new IllegalArgumentException("illegal")), equalTo(RestStatus.BAD_REQUEST));
114+
assertThat(ExceptionsHelper.status(new InputCoercionException(null, "illegal", null, null)), equalTo(RestStatus.BAD_REQUEST));
113115
assertThat(ExceptionsHelper.status(new JsonParseException(null, "illegal")), equalTo(RestStatus.BAD_REQUEST));
114116
assertThat(ExceptionsHelper.status(new OpenSearchRejectedExecutionException("rejected")), equalTo(RestStatus.TOO_MANY_REQUESTS));
115117
}
116118

117119
public void testSummaryMessage() {
118120
assertThat(ExceptionsHelper.summaryMessage(new IllegalArgumentException("illegal")), equalTo("Invalid argument"));
121+
assertThat(
122+
ExceptionsHelper.summaryMessage(new InputCoercionException(null, "illegal", null, null)),
123+
equalTo("Incompatible JSON value")
124+
);
119125
assertThat(ExceptionsHelper.summaryMessage(new JsonParseException(null, "illegal")), equalTo("Failed to parse JSON"));
120126
assertThat(ExceptionsHelper.summaryMessage(new OpenSearchRejectedExecutionException("rejected")), equalTo("Too many requests"));
121127
}

0 commit comments

Comments
 (0)