mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Fetch the simple name of the class instead of doing regex dances.
This commit is contained in:
parent
736b04e181
commit
d7d562bd58
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user