public static String getStackMsg(Exception e){
StringBuffer sb=new StringBuffer();
StackTraceElement[] stackArray=e.getStackTrace();
for (int i = 0; i < stackArray.length; i++) {
StackTraceElement element=stackArray[i];
sb.append(element.toString()+"\r\n");
}
return sb.toString();
}
把异常转换为字符串
最新推荐文章于 2022-11-04 15:50:17 发布