Another sync of ElasticsearchException ids with 2.0

This commit is contained in:
Jason Tedor 2015-09-25 16:43:01 -04:00
parent 5571c327c5
commit f40ae25352
2 changed files with 10 additions and 12 deletions

View File

@ -500,7 +500,9 @@ public class ElasticsearchException extends RuntimeException implements ToXConte
MAPPER_EXCEPTION(org.elasticsearch.index.mapper.MapperException.class, org.elasticsearch.index.mapper.MapperException::new, 37),
INVALID_TYPE_NAME_EXCEPTION(org.elasticsearch.indices.InvalidTypeNameException.class, org.elasticsearch.indices.InvalidTypeNameException::new, 38),
SNAPSHOT_RESTORE_EXCEPTION(org.elasticsearch.snapshots.SnapshotRestoreException.class, org.elasticsearch.snapshots.SnapshotRestoreException::new, 39),
PARSING_EXCEPTION(org.elasticsearch.common.ParsingException.class, org.elasticsearch.common.ParsingException::new, 40),
INDEX_SHARD_CLOSED_EXCEPTION(org.elasticsearch.index.shard.IndexShardClosedException.class, org.elasticsearch.index.shard.IndexShardClosedException::new, 41),
RECOVER_FILES_RECOVERY_EXCEPTION(org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException::new, 42),
TRUNCATED_TRANSLOG_EXCEPTION(org.elasticsearch.index.translog.TruncatedTranslogException.class, org.elasticsearch.index.translog.TruncatedTranslogException::new, 43),
RECOVERY_FAILED_EXCEPTION(org.elasticsearch.indices.recovery.RecoveryFailedException.class, org.elasticsearch.indices.recovery.RecoveryFailedException::new, 44),
INDEX_SHARD_RELOCATED_EXCEPTION(org.elasticsearch.index.shard.IndexShardRelocatedException.class, org.elasticsearch.index.shard.IndexShardRelocatedException::new, 45),
@ -596,10 +598,8 @@ public class ElasticsearchException extends RuntimeException implements ToXConte
STRICT_DYNAMIC_MAPPING_EXCEPTION(org.elasticsearch.index.mapper.StrictDynamicMappingException.class, org.elasticsearch.index.mapper.StrictDynamicMappingException::new, 135),
RETRY_ON_REPLICA_EXCEPTION(org.elasticsearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException.class, org.elasticsearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException::new, 136),
TYPE_MISSING_EXCEPTION(org.elasticsearch.indices.TypeMissingException.class, org.elasticsearch.indices.TypeMissingException::new, 137),
PARSING_EXCEPTION(org.elasticsearch.common.ParsingException.class, org.elasticsearch.common.ParsingException::new, 140),
RECOVER_FILES_RECOVERY_EXCEPTION(org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException::new, 141),
FAILED_TO_COMMIT_CLUSTER_STATE_EXCEPTION(org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException::new, 142),
QUERY_SHARD_EXCEPTION(org.elasticsearch.index.query.QueryShardException.class, org.elasticsearch.index.query.QueryShardException::new, 143);
FAILED_TO_COMMIT_CLUSTER_STATE_EXCEPTION(org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException::new, 140),
QUERY_SHARD_EXCEPTION(org.elasticsearch.index.query.QueryShardException.class, org.elasticsearch.index.query.QueryShardException::new, 141);
final Class<? extends ElasticsearchException> exceptionClass;
final FunctionThatThrowsIOException<StreamInput, ? extends ElasticsearchException> constructor;

View File

@ -227,13 +227,13 @@ public class ExceptionSerializationTests extends ESTestCase {
ParsingException ex = serialize(new ParsingException(1, 2, "fobar", null));
assertNull(ex.getIndex());
assertEquals(ex.getMessage(), "fobar");
assertEquals(ex.getLineNumber(),1);
assertEquals(ex.getLineNumber(), 1);
assertEquals(ex.getColumnNumber(), 2);
ex = serialize(new ParsingException(1, 2, null, null));
assertNull(ex.getIndex());
assertNull(ex.getMessage());
assertEquals(ex.getLineNumber(),1);
assertEquals(ex.getLineNumber(), 1);
assertEquals(ex.getColumnNumber(), 2);
}
@ -697,9 +697,9 @@ public class ExceptionSerializationTests extends ESTestCase {
ids.put(37, org.elasticsearch.index.mapper.MapperException.class);
ids.put(38, org.elasticsearch.indices.InvalidTypeNameException.class);
ids.put(39, org.elasticsearch.snapshots.SnapshotRestoreException.class);
ids.put(40, null);
ids.put(40, org.elasticsearch.common.ParsingException.class);
ids.put(41, org.elasticsearch.index.shard.IndexShardClosedException.class);
ids.put(42, null);
ids.put(42, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class);
ids.put(43, org.elasticsearch.index.translog.TruncatedTranslogException.class);
ids.put(44, org.elasticsearch.indices.recovery.RecoveryFailedException.class);
ids.put(45, org.elasticsearch.index.shard.IndexShardRelocatedException.class);
@ -797,10 +797,8 @@ public class ExceptionSerializationTests extends ESTestCase {
ids.put(137, org.elasticsearch.indices.TypeMissingException.class);
ids.put(138, null);
ids.put(139, null);
ids.put(140, org.elasticsearch.common.ParsingException.class);
ids.put(141, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class);
ids.put(142, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class);
ids.put(143, org.elasticsearch.index.query.QueryShardException.class);
ids.put(140, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class);
ids.put(141, org.elasticsearch.index.query.QueryShardException.class);
Map<Class<? extends ElasticsearchException>, Integer> reverse = new HashMap<>();
for (Map.Entry<Integer, Class<? extends ElasticsearchException>> entry : ids.entrySet()) {