代码拉取完成,页面将自动刷新
package cn.platform.agent.frame.core.helper;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* <p>标题: 异常堆栈信息工具类</p>
* <p>功能描述: </p>
* <p>版权: 税友软件集团股份限公司</p>
* <p>创建时间:16/12/22 </p>
* <p>作者:SIVEN</p>
* <p>修改历史记录:</p>
* ============================================================<br>
*/
public class StackTraceHelper {
public static String getMessage(String message , Exception e){
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
String exceptionInfo = sw.toString();
return message + " ,Error Message: " +exceptionInfo;
} catch (Exception e1) {
return "get StackTrace Message abnormal!!";
}
}
/**
* 将捕获的异常信息转String
*
* @param e
* @return
*/
public static String getMessage(Exception e) {
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
String exceptionInfo = sw.toString();
return exceptionInfo;
} catch (Exception e1) {
return "get StackTrace Message abnormal!!";
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。