1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Fetch the simple name of the class instead of doing regex dances.

This commit is contained in:
Andrew Chen 2013-01-06 12:40:03 -08:00
parent 736b04e181
commit d7d562bd58

View File

@ -1734,12 +1734,9 @@ public class MessagingController implements Runnable {
} else {
// Remove the namespace on the exception so we have a fighting chance of seeing more of the error in the
// notification.
String cause = rootCause.toString();
if (StringUtils.isNullOrEmpty(cause)) {
return cause;
} else {
return cause.replaceFirst("^[\\w.]+?([\\w]+:)", "$1");
}
return (rootCause.getLocalizedMessage() != null)
? (rootCause.getClass().getSimpleName() + ": " + rootCause.getLocalizedMessage())
: rootCause.getClass().getSimpleName();
}
}