/** * Try to resolve the message. Treat as an error if the message can't be found. * * @param code code to lookup up, such as 'calculator.noRateSet' * @param locale Locale in which to do lookup * @return message * @throws NoSuchMessageException not found in any locale */ public final String getMessage(String code, Locale locale) throws NoSuchMessageException { try { String mesg = resolve(code, locale); if (mesg == null) { if (parent != null) return parent.getMessage(code, locale); throw new NoSuchMessageException(code); } return mesg; } catch (Exception ex) { // OR RTE? throw new NoSuchMessageException(code); // TODO ** Log warning } }