mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -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 {
|
} else {
|
||||||
// Remove the namespace on the exception so we have a fighting chance of seeing more of the error in the
|
// Remove the namespace on the exception so we have a fighting chance of seeing more of the error in the
|
||||||
// notification.
|
// notification.
|
||||||
String cause = rootCause.toString();
|
return (rootCause.getLocalizedMessage() != null)
|
||||||
if (StringUtils.isNullOrEmpty(cause)) {
|
? (rootCause.getClass().getSimpleName() + ": " + rootCause.getLocalizedMessage())
|
||||||
return cause;
|
: rootCause.getClass().getSimpleName();
|
||||||
} else {
|
|
||||||
return cause.replaceFirst("^[\\w.]+?([\\w]+:)", "$1");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user