1 package org.wikimedia.search.extra.regex;
2
3 import java.util.Locale;
4
5 import javax.annotation.Nullable;
6
7 /**
8 * Thrown when the filter is unable to accelerate a regex and
9 * rejectUnaccelerated is set.
10 */
11 public class UnableToAccelerateRegexException extends RuntimeException {
12 public UnableToAccelerateRegexException(String regex, int gramSize, @Nullable String ngramField) {
13 super(String.format(Locale.ROOT, "Unable to accelerate \"%s\" with %s sized grams stored in %s", regex, gramSize, ngramField));
14 }
15 }