diff --git a/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java b/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java index e8e3f6f6d20..1affc8bd0d9 100644 --- a/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java +++ b/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java @@ -524,6 +524,14 @@ public abstract class StreamInput extends InputStream { return (T) readStackTrace(new EOFException(eofMessage), this); case 9: return (T) readStackTrace(new SecurityException(readOptionalString(), readThrowable()), this); + case 10: + final String sidxMessage = readOptionalString(); + readThrowable(); + return (T) readStackTrace(new StringIndexOutOfBoundsException(sidxMessage), this); + case 11: + final String aidxMessage = readOptionalString(); + readThrowable(); + return (T) readStackTrace(new ArrayIndexOutOfBoundsException(aidxMessage), this); default: assert false : "no such exception for id: " + key; } diff --git a/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java b/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java index fc4726d6c28..75e81f7d6ec 100644 --- a/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java +++ b/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java @@ -471,6 +471,10 @@ public abstract class StreamOutput extends OutputStream { writeVInt(8); } else if (throwable instanceof SecurityException) { writeVInt(9); + } else if (throwable instanceof StringIndexOutOfBoundsException) { + writeVInt(10); + } else if (throwable instanceof ArrayIndexOutOfBoundsException) { + writeVInt(11); } else { ElasticsearchException ex; final String name = throwable.getClass().getName();