/** Extracts previously attached localized message for a given throwable. * Complements {@link #attachLocalizedMessage}. * * @param t the exception to search for a message in * @return localized message attached to provided exception or <code>null</code> * if no such message has been attached */ public static String findLocalizedMessage(Throwable t) { while (t != null) { String msg; AnnException extra = AnnException.extras.get(t); if (extra != null) { msg = extractLocalizedMessage(extra); } else { msg = extractLocalizedMessage(t); } if (msg != null) { return msg; } t = t.getCause(); } return null; }
/** Extracts previously attached localized message for a given throwable. * Complements {@link #attachLocalizedMessage}. * * @param t the exception to search for a message in * @return localized message attached to provided exception or <code>null</code> * if no such message has been attached */ public static String findLocalizedMessage(Throwable t) { while (t != null) { String msg; AnnException extra = AnnException.extras.get(t); if (extra != null) { msg = extractLocalizedMessage(extra); } else { msg = extractLocalizedMessage(t); } if (msg != null) { return msg; } t = t.getCause(); } return null; }
/** Extracts previously attached localized message for a given throwable. * Complements {@link #attachLocalizedMessage}. * * @param t the exception to search for a message in * @return localized message attached to provided exception or <code>null</code> * if no such message has been attached */ public static String findLocalizedMessage(Throwable t) { while (t != null) { String msg; AnnException extra = AnnException.extras.get(t); if (extra != null) { msg = extractLocalizedMessage(extra); } else { msg = extractLocalizedMessage(t); } if (msg != null) { return msg; } t = t.getCause(); } return null; }