Remove `ElasticsearchIllegalArgumentException` and `ElasticsearchIllegalStateException` in favor of the JDK one

Related to https://github.com/elastic/elasticsearch/issues/10794

Closes #41.
This commit is contained in:
David Pilato 2015-04-29 18:52:41 +02:00
parent 616c64d666
commit 2103c8f2d2
1 changed files with 3 additions and 4 deletions

View File

@ -29,7 +29,6 @@ import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.phonetic.BeiderMorseFilter;
import org.apache.lucene.analysis.phonetic.DoubleMetaphoneFilter;
import org.apache.lucene.analysis.phonetic.PhoneticFilter;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.assistedinject.Assisted;
import org.elasticsearch.common.settings.Settings;
@ -90,7 +89,7 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory {
} else if ("exact".equalsIgnoreCase(ruleType)) {
ruletype = RuleType.EXACT;
} else {
throw new ElasticsearchIllegalArgumentException("No matching rule type [" + ruleType + "] for beider morse encoder");
throw new IllegalArgumentException("No matching rule type [" + ruleType + "] for beider morse encoder");
}
String nameType = settings.get("name_type", "generic");
if ("GENERIC".equalsIgnoreCase(nameType)) {
@ -107,7 +106,7 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory {
} else if ("nysiis".equalsIgnoreCase(encodername)) {
this.encoder = new Nysiis();
} else {
throw new ElasticsearchIllegalArgumentException("unknown encoder [" + encodername + "] for phonetic token filter");
throw new IllegalArgumentException("unknown encoder [" + encodername + "] for phonetic token filter");
}
}
@ -127,6 +126,6 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory {
} else {
return new PhoneticFilter(tokenStream, encoder, !replace);
}
throw new ElasticsearchIllegalArgumentException("encoder error");
throw new IllegalArgumentException("encoder error");
}
}