Here you can find the source of getExceptionMessage(Throwable e)
public static String getExceptionMessage(Throwable e)
public class Main{ public static final int LEN = 80; public static String getExceptionMessage(Throwable e) { String message = e.getMessage(); if (StringUtil.isEmpty(message)) { message = e.getClass().getSimpleName() .replaceFirst("Exception", ""); }//from www .j a v a2s. c o m if (message.length() > LEN) { message = message.substring(0, LEN) + "..."; } return message; } public static boolean isEmpty(String value) { return value == null || value.trim().length() == 0; } }