mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Core: reduce the size of the XContent parsing exception
The content that caused the exception can be potentially very big and in most cases it's not very useful for debugging.
This commit is contained in:
parent
3a97f322f7
commit
e34cb18f8a
@ -177,7 +177,7 @@ public class XContentFactory {
|
||||
public static XContent xContent(CharSequence content) {
|
||||
XContentType type = xContentType(content);
|
||||
if (type == null) {
|
||||
throw new ElasticsearchParseException("Failed to derive xcontent from " + content);
|
||||
throw new ElasticsearchParseException("Failed to derive xcontent");
|
||||
}
|
||||
return xContent(type);
|
||||
}
|
||||
@ -195,7 +195,7 @@ public class XContentFactory {
|
||||
public static XContent xContent(byte[] data, int offset, int length) {
|
||||
XContentType type = xContentType(data, offset, length);
|
||||
if (type == null) {
|
||||
throw new ElasticsearchParseException("Failed to derive xcontent from (offset=" + offset + ", length=" + length + "): " + Arrays.toString(data));
|
||||
throw new ElasticsearchParseException("Failed to derive xcontent");
|
||||
}
|
||||
return xContent(type);
|
||||
}
|
||||
@ -290,7 +290,7 @@ public class XContentFactory {
|
||||
public static XContent xContent(BytesReference bytes) {
|
||||
XContentType type = xContentType(bytes);
|
||||
if (type == null) {
|
||||
throw new ElasticsearchParseException("Failed to derive xcontent from " + bytes);
|
||||
throw new ElasticsearchParseException("Failed to derive xcontent");
|
||||
}
|
||||
return xContent(type);
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ public class MultiPercolatorTests extends ElasticsearchIntegrationTest {
|
||||
assertThat(item.getResponse().getSuccessfulShards(), equalTo(0));
|
||||
assertThat(item.getResponse().getShardFailures().length, equalTo(test.numPrimaries));
|
||||
for (ShardOperationFailedException shardFailure : item.getResponse().getShardFailures()) {
|
||||
assertThat(shardFailure.reason(), containsString("Failed to derive xcontent from"));
|
||||
assertThat(shardFailure.reason(), containsString("Failed to derive xcontent"));
|
||||
assertThat(shardFailure.status().getStatus(), equalTo(500));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user