diff --git a/server/src/main/java/org/elasticsearch/ElasticsearchException.java b/server/src/main/java/org/elasticsearch/ElasticsearchException.java index ebfb2e270be..2e04d03438e 100644 --- a/server/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/server/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -1006,11 +1006,11 @@ public class ElasticsearchException extends RuntimeException implements ToXConte UNKNOWN_NAMED_OBJECT_EXCEPTION(org.elasticsearch.common.xcontent.UnknownNamedObjectException.class, org.elasticsearch.common.xcontent.UnknownNamedObjectException::new, 148, UNKNOWN_VERSION_ADDED), TOO_MANY_BUCKETS_EXCEPTION(MultiBucketConsumerService.TooManyBucketsException.class, - MultiBucketConsumerService.TooManyBucketsException::new, 149, Version.V_7_0_0), + MultiBucketConsumerService.TooManyBucketsException::new, 149, Version.V_6_2_0), COORDINATION_STATE_REJECTED_EXCEPTION(org.elasticsearch.cluster.coordination.CoordinationStateRejectedException.class, org.elasticsearch.cluster.coordination.CoordinationStateRejectedException::new, 150, Version.V_7_0_0), SNAPSHOT_IN_PROGRESS_EXCEPTION(org.elasticsearch.snapshots.SnapshotInProgressException.class, - org.elasticsearch.snapshots.SnapshotInProgressException::new, 151, Version.V_7_0_0), + org.elasticsearch.snapshots.SnapshotInProgressException::new, 151, Version.V_6_7_0), NO_SUCH_REMOTE_CLUSTER_EXCEPTION(org.elasticsearch.transport.NoSuchRemoteClusterException.class, org.elasticsearch.transport.NoSuchRemoteClusterException::new, 152, Version.V_6_7_0); diff --git a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 00354fd19da..901a4c3df01 100644 --- a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -363,9 +363,9 @@ public class ExceptionSerializationTests extends ESTestCase { } public void testTooManyBucketsException() throws IOException { + Version version = VersionUtils.randomVersionBetween(random(), Version.V_6_2_0, Version.CURRENT); MultiBucketConsumerService.TooManyBucketsException ex = - serialize(new MultiBucketConsumerService.TooManyBucketsException("Too many buckets", 100), - randomFrom(Version.V_7_0_0)); + serialize(new MultiBucketConsumerService.TooManyBucketsException("Too many buckets", 100), version); assertEquals("Too many buckets", ex.getMessage()); assertEquals(100, ex.getMaxBuckets()); } @@ -880,6 +880,13 @@ public class ExceptionSerializationTests extends ESTestCase { assertEquals(orig.getShardId(), ex.getShardId()); } + public void testSnapshotInProgressException() throws IOException { + SnapshotInProgressException orig = new SnapshotInProgressException("boom"); + Version version = VersionUtils.randomVersionBetween(random(), Version.V_6_7_0, Version.CURRENT); + SnapshotInProgressException ex = serialize(orig, version); + assertEquals(orig.getMessage(), ex.getMessage()); + } + private static class UnknownException extends Exception { UnknownException(final String message, final Exception cause) { super(message, cause);