/**
* 获取格式化堆栈异常信息
* @param e
* @return
*/
public static String getStackMsg(Exception e) {
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
return sw.toString() + "\r\n";
} catch (Exception e2) {
return "bad getErrorInfoFromException";
}
}
java中将完整的exception以String字符串进行输出和保存
最新推荐文章于 2023-08-11 16:05:03 发布