public static String getErrorMsg(Throwable thr) {
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter= new PrintWriter(stringWriter);
try {
thr.printStackTrace(printWriter);
return stringWriter.toString();
} finally {
if(printWriter != null) {
printWriter.close();
}
}
}
获取异常详细信息工具类
最新推荐文章于 2024-11-18 12:10:44 发布