根据exception 异常堆栈信息

来源:互联网 发布:tensorflow 小说生成 编辑:程序博客网 时间:2024/05/16 10:02
public static String getExceptionStackTrace(Throwable ex)    {        Writer info = new StringWriter();        PrintWriter printWriter = new PrintWriter(info);        ex.printStackTrace(printWriter);        Throwable cause = ex.getCause();        while (cause != null)        {            cause.printStackTrace(printWriter);            cause = cause.getCause();        }        return info.toString();    }

0 0
原创粉丝点击