获取异常详细信息

public static String getExceptionAll(Exception ex) {
        StringBuilder builder = new StringBuilder();
        StackTraceElement[] trace = ex.getStackTrace();
        for (StackTraceElement s : trace) {
            builder.append(s);
            builder.append("\r\n");
        }
        return builder.toString();
    }

你可能感兴趣的:(获取异常详细信息)