From d7d562bd58aec8bfbef72d30a27a444146718ab4 Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Sun, 6 Jan 2013 12:40:03 -0800 Subject: [PATCH] Fetch the simple name of the class instead of doing regex dances. --- src/com/fsck/k9/controller/MessagingController.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 1428a6666..64a56d9b5 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -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(); } }