Skip to content

Commit

Permalink
Remove ElasticsearchIllegalArgumentException and `ElasticsearchIlle…
Browse files Browse the repository at this point in the history
…galStateException` in favor of the JDK one

Related to elastic/elasticsearch#10794

Closes #41.
  • Loading branch information
dadoonet committed Apr 29, 2015
1 parent 616c64d commit 2103c8f
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -29,7 +29,6 @@
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;
Expand Down Expand Up @@ -90,7 +89,7 @@ public PhoneticTokenFilterFactory(Index index, @IndexSettings Settings indexSett
} 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)) {
Expand All @@ -107,7 +106,7 @@ public PhoneticTokenFilterFactory(Index index, @IndexSettings Settings indexSett
} 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");
}
}

Expand All @@ -127,6 +126,6 @@ public TokenStream create(TokenStream tokenStream) {
} else {
return new PhoneticFilter(tokenStream, encoder, !replace);
}
throw new ElasticsearchIllegalArgumentException("encoder error");
throw new IllegalArgumentException("encoder error");
}
}

0 comments on commit 2103c8f

Please sign in to comment.