Handle bad formats with an exception. Translators MAKE SURE you watch for this error!

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw 2019-02-13 18:54:43 -05:00
parent 4441935a4a
commit 64a92530d9
No known key found for this signature in database
GPG key ID: 8EB3DF749553B1B7

View file

@ -88,7 +88,12 @@ public class ForgeI18n {
public static String parseMessage(final String i18nMessage, Object... args) {
final String pattern = getPattern(i18nMessage);
return parseFormat(pattern, args);
try {
return parseFormat(pattern, args);
} catch (IllegalArgumentException e) {
LOGGER.error("Illegal format found {}", pattern, e);
return pattern;
}
}
public static String parseFormat(final String format, final Object... args) {