1 //获取异常原因详情 2 public static String getExceptionInfo(Exception ex){ 3 String sOut = ex.toString()+ "\r\n"; 4 StackTraceElement[] trace = ex.getStackTrace(); 5 for (StackTraceElement s : trace) { 6 sOut += "\tat " + s + "\r\n"; 7 } 8 return sOut; 9 }