!205 fix:不使用国际化时输出消息

Merge pull request !205 from 王帅/main
This commit is contained in:
Michael Yang 2023-07-29 02:35:58 +00:00 committed by Gitee
commit bc22d4dffc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -65,6 +65,9 @@ public class MybatisFlexException extends RuntimeException {
} }
private String getMessage(Locale locale) { private String getMessage(Locale locale) {
if (pattern == null) {
return super.getMessage();
}
String localizedString = pattern.getLocalizedString(locale); String localizedString = pattern.getLocalizedString(locale);
return MessageFormat.format(localizedString, arguments); return MessageFormat.format(localizedString, arguments);
} }