class ErrorUtil {

    public static String singleLineExceptionTrace(Exception e) {
        String m = e.toString();
        String stackTraceString = stackTraceString(e);
        String[] stackTraceLines = stackTraceString.split("\n");
        String lastMethod = stackTraceLines.length == 0 ? "" : stackTraceLines[1].replace("\t", "");
        return String.format("%s (%s)", m, lastMethod);
    }

}