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
1 changed files with 3 additions and 6 deletions

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();
}
}